浏览代码

HDRenderPipeline: Working version of fixed tesselation

/main
sebastienlagarde 8 年前
当前提交
1f56f50b
共有 2 个文件被更改,包括 15 次插入6 次删除
  1. 10
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTesselation.hlsl
  2. 11
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTessellation.shader

10
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTesselation.hlsl


float4 TesselationEdge(Attributes input0, Attributes input1, Attributes input2)
{
float minDist = 0; // _TessNear;
float maxDist = 15; // _TessFar;
// float minDist = 0; // _TessNear;
// float maxDist = 15; // _TessFar;
return UnityDistanceBasedTess(input0.positionOS, input1.positionOS, input2.positionOS, minDist, maxDist, 0.5 /* _Tess */, unity_ObjectToWorld, _WorldSpaceCameraPos);
// return UnityDistanceBasedTess(input0.positionOS, input1.positionOS, input2.positionOS, minDist, maxDist, 0.5 /* _Tess */, unity_ObjectToWorld, _WorldSpaceCameraPos);
return float4(10.0, 10.0, 10.0, 10.0);
}
void Displacement(inout Attributes v)

float d = ((tex2Dlod(_DispTex, float4(v.texcoord.xy * _Tiling, 0, 0)).r) - _DisplacementCenter) * (_Displacement * LengthLerp);
d /= max(0.0001, _Tiling);
*/
v.positionOS.xyz += float3(0.5, 0.5, 0.5); // v.normalOS * 5.0;
// v.positionOS.xyz += 10 * float3(0.5, 0.5, 0.5); // v.normalOS * 5.0;
}

11
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitTessellation.shader


#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitProperties.hlsl"
// All our shaders use same name for entry point
#pragma vertex Vert
#pragma fragment Frag
ENDHLSL

HLSLPROGRAM
#pragma vertex VertTesselation
#pragma hull Hull
#pragma domain Domain

HLSLPROGRAM
#pragma vertex VertTesselation
#pragma hull Hull
#pragma domain Domain

// both direct and indirect lighting) will hand up in the "regular" lightmap->LIGHTMAP_ON.
// No tesselation for Meta pass
#pragma vertex Vert
#define SHADERPASS SHADERPASS_LIGHT_TRANSPORT
#include "../../Material/Material.hlsl"

HLSLPROGRAM
#pragma vertex VertTesselation
#pragma hull Hull
#pragma domain Domain

HLSLPROGRAM
#pragma vertex VertTesselation
#pragma hull Hull
#pragma domain Domain

HLSLPROGRAM
#pragma vertex VertTesselation
#pragma hull Hull
#pragma domain Domain

HLSLPROGRAM
#pragma vertex VertTesselation
#pragma hull Hull
#pragma domain Domain

HLSLPROGRAM
#pragma vertex VertTesselation
#pragma hull Hull
#pragma domain Domain

}
}
CustomEditor "Experimental.ScriptableRenderLoop.LitGUI"
CustomEditor "Experimental.Rendering.HDPipeline.LitGUI"
}
正在加载...
取消
保存