While compiling the following code. I get a error
float tess = saturate((gMinTessDistance - d) / (gMinTessDistance - gMaxTessDistance));
// Rescale [0,1] --> [gMinTessFactor, gMaxTessFactor].
vout.TessFactor = tess;
if i do this it works.
float tess = saturate((gMinTessDistance - d) / (gMinTessDistance - gMaxTessDistance));
// Rescale [0,1] --> [gMinTessFactor, gMaxTessFactor].
vout.TessFactor = 0.4;
..
struct VertexOut
{
float3 PosL : POSITION;
float3 NormalW : NORMAL;
float3 TangentW : TANGENT;
float2 Tex : TEXCOORD;
float TessFactor : TESS;
};
Here is code for vertex shader part
VertexOut VS(VertexIn vin)
{
VertexOut vout;
// Transform to world space space.
vout.PosL = mul(float4(vin.PosL, 1.0f), gWorld).xyz;
vout.NormalW = mul(vin.NormalL, (float3x3)gWorld);
vout.TangentW = mul(vin.TangentL, (float3x3)gWorld);
// Output vertex attributes for interpolation across triangle.
vout.Tex = mul(float4(vin.Tex, 0.0f, 1.0f), gTexTransform).xy;
float d = distance(vout.PosL, gEyePosW);
// Normalized tessellation factor.
// The tessellation is
// 0 if d >= gMinTessDistance and
// 1 if d <= gMaxTessDistance.
float tess = saturate((gMinTessDistance - d) / (gMinTessDistance - gMaxTessDistance));
// Rescale [0,1] --> [gMinTessFactor, gMaxTessFactor].
vout.TessFactor = tess;
return vout;
}
Im in Directx 12 Shader model 5.0