2014-05-03 13:17:33 +00:00
|
|
|
#version 330
|
|
|
|
#extension GL_ARB_tessellation_shader : require
|
|
|
|
|
|
|
|
layout(vertices = 3) out;
|
|
|
|
in vec3 vPosition[];
|
2014-05-16 07:10:09 +00:00
|
|
|
in vec2 vTexCoord[];
|
2014-05-03 13:17:33 +00:00
|
|
|
in vec3 vNormal[];
|
|
|
|
out vec3 tcPosition[];
|
2014-05-16 07:10:09 +00:00
|
|
|
out vec2 tcTexCoord[];
|
2014-05-03 13:17:33 +00:00
|
|
|
out vec3 tcNormal[];
|
|
|
|
uniform float TessLevelInner = 1.0; // controlled by keyboard buttons
|
|
|
|
uniform float TessLevelOuter = 1.0; // controlled by keyboard buttons
|
|
|
|
|
|
|
|
#define ID gl_InvocationID
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
tcPosition[ID] = vPosition[ID];
|
2014-05-16 07:10:09 +00:00
|
|
|
tcTexCoord[ID] = vTexCoord[ID];
|
2014-05-03 13:17:33 +00:00
|
|
|
tcNormal[ID] = vNormal[ID];
|
|
|
|
if (ID == 0) {
|
|
|
|
gl_TessLevelInner[0] = TessLevelInner;
|
|
|
|
gl_TessLevelOuter[0] = TessLevelOuter;
|
|
|
|
gl_TessLevelOuter[1] = TessLevelOuter;
|
|
|
|
gl_TessLevelOuter[2] = TessLevelOuter;
|
|
|
|
}
|
2014-05-16 07:10:09 +00:00
|
|
|
}
|