Calculate smooth normals in TES
This commit is contained in:
parent
294c2f3c85
commit
1c75e7ddd8
|
@ -15,17 +15,18 @@ out TC_OUT {
|
|||
uniform float tessellationFactor;
|
||||
|
||||
void main() {
|
||||
// Pass through position and texture coordinates to the tessellation evaluation shader
|
||||
tc_out[gl_InvocationID].position = tc_in[gl_InvocationID].position;
|
||||
tc_out[gl_InvocationID].texCoord = tc_in[gl_InvocationID].texCoord;
|
||||
|
||||
// Set tessellation levels
|
||||
if (gl_InvocationID == 0) {
|
||||
gl_TessLevelOuter[0] = tessellationFactor; // Level of tessellation along one edge
|
||||
gl_TessLevelOuter[1] = tessellationFactor; // Level of tessellation along another edge
|
||||
gl_TessLevelOuter[2] = tessellationFactor; // Level of tessellation along the other edge
|
||||
gl_TessLevelOuter[3] = tessellationFactor; // Level of tessellation along the other edge
|
||||
|
||||
gl_TessLevelInner[0] = tessellationFactor; // Level of tessellation for the inner part
|
||||
gl_TessLevelInner[1] = tessellationFactor; // Level of tessellation for the inner part
|
||||
}
|
||||
|
||||
// Pass through position and texture coordinates to the tessellation evaluation shader
|
||||
tc_out[gl_InvocationID].position = tc_in[gl_InvocationID].position;
|
||||
tc_out[gl_InvocationID].texCoord = tc_in[gl_InvocationID].texCoord;
|
||||
}
|
Loading…
Reference in New Issue