perf: optmize world rendering performance

This commit is contained in:
2026-03-08 11:27:37 +08:00
parent 668fa9a57d
commit f3ff209823
7 changed files with 149 additions and 113 deletions

View File

@@ -2,8 +2,9 @@
layout (location = 0) in vec3 pos;
layout (location = 1) in vec2 texCoord;
layout (location = 2) in float layer;
out vec2 tc;
flat out int tex_layer;
mat4 buildRotateX(float rad);
mat4 buildRotateY(float rad);
@@ -13,11 +14,12 @@ mat4 buildTranslate(float x, float y, float z);
uniform mat4 mv_matrix;
uniform mat4 proj_matrix;
layout (binding = 0) uniform sampler2D samp;
void main(void) {
gl_Position = proj_matrix * mv_matrix * vec4(pos, 1.0);
tc = texCoord;
tex_layer = int(layer);
}
mat4 buildTranslate(float x, float y, float z) {