@@ -12,12 +12,10 @@ Vertex shader for
1212#include < Bindless// VertexData.glsl>
1313
1414layout (location = 0 ) out vec3 worldPos;
15- layout (location = 1 ) out vec2 texCoord;
16- layout (location = 2 ) out vec3 normal;
17- layout (location = 3 ) out vec3 viewPos;
18- // layout(location = 3) out vec4 shadowPos;
15+ layout (location = 1 ) out vec3 viewPos;
16+ layout (location = 2 ) out vec2 texCoord;
17+ layout (location = 3 ) out vec3 normal;
1918layout (location = 4 ) out flat uint meshIndex;
20- // layout(location = 5) out flat uint cascadeIndex;
2119
2220// UBO
2321layout (set = 0 , binding = 0 )
@@ -60,20 +58,9 @@ void main()
6058 mat3 normalMatrix = transpose (inverse(mat3 (model)));
6159
6260 worldPos = (model * vertexData.position).xyz;
63-
64- // Calculate cascade index
6561 viewPos = (camUBO.view * vec4 (worldPos, 1.0 )).xyz;
66- /* for (uint i = 0; i < SHADOW_MAP_CASCADE_COUNT - 1; ++i)
67- {
68- if (viewPos.z < shadowUBO.splitDepths[i])
69- {
70- cascadeIndex = i + 1;
71- }
72- }*/
73-
7462 texCoord = vertexData.uv.xy;
7563 normal = normalMatrix * vertexData.normal.xyz;
7664 meshIndex = gl_BaseInstance;
77- // shadowPos = biasMat * shadowUBO.lightSpaceMatrices[cascadeIndex] * model * vertexData.position;
7865 gl_Position = camUBO.projection * camUBO.view * vec4 (worldPos, 1.0 );
7966}
0 commit comments