void surfaceFunction(VertexIn In, out RangeOut Out) { Out.Attributes = float4(In.Attributes.r, 0, 0, 1); } SurfaceOut surfaceFunction(VertexIn In) { SurfaceOut Out = (SurfaceOut)0; float v = smoothstep(range.x, range.y, In.Attributes.r); float m = 0.1; Out.Color = lerp( lerp(float4(m, m, m, 1), float4(m, m, 0.8, 1), smoothstep(0, 0.33, v)), lerp(float4(m, 0.8, m, 1), float4(0.8, m, m, 1), smoothstep(0.66, 1, v)), smoothstep(0.33, 0.66, v)); float3 normalX = ddx_fine(In.ViewSpacePosition.xyz); float3 normalY = ddy_fine(In.ViewSpacePosition.xyz); float3 normal = normalize(cross(normalY, normalX)); Out.Normal = normal; Out.LightModel = 1; return Out; }