mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
Replaces per-entity draw calls with instanced rendering for both main and shadow passes. Each model's node hierarchy is flattened once and instance matrices are updated per frame, reducing draw calls and CPU overhead.
13 lines
279 B
GLSL
13 lines
279 B
GLSL
#version 460
|
|
|
|
layout (location = 0) in vec3 pos;
|
|
layout (location = 1) in vec2 texCoord;
|
|
layout (location = 3) in mat4 modelMatrix;
|
|
uniform mat4 lightSpaceMatrix;
|
|
|
|
out vec2 tc;
|
|
|
|
void main() {
|
|
tc = texCoord;
|
|
gl_Position = lightSpaceMatrix * modelMatrix * vec4(pos, 1.0);
|
|
} |