Add GeoData to TEC

This commit is contained in:
Jack 2024-08-25 23:04:34 -04:00
parent c4f539c5b8
commit a92b85ab35
1 changed files with 17 additions and 6 deletions

View File

@ -5,6 +5,17 @@ layout(vertices = 4) out;
layout(binding = 0) uniform sampler2D heightTexture;
uniform float tessellationFactor;
layout(std140, binding = 4) uniform GeoUniforms
{
mat4 PV;
mat4 M;
float minTessellation;
float maxTessellation;
float displacementScale;
int gridDensity;
};
in VS_OUT {
vec3 position;
vec2 texCoord;
@ -22,12 +33,12 @@ void main() {
// Set tessellation levels
if (gl_InvocationID == 0) {
gl_TessLevelOuter[0] = tessellationFactor;
gl_TessLevelOuter[1] = tessellationFactor;
gl_TessLevelOuter[2] = tessellationFactor;
gl_TessLevelOuter[3] = tessellationFactor;
gl_TessLevelOuter[0] = maxTessellation;
gl_TessLevelOuter[1] = maxTessellation;
gl_TessLevelOuter[2] = maxTessellation;
gl_TessLevelOuter[3] = maxTessellation;
gl_TessLevelInner[0] = tessellationFactor;
gl_TessLevelInner[1] = tessellationFactor;
gl_TessLevelInner[0] = maxTessellation;
gl_TessLevelInner[1] = maxTessellation;
}
}