mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-17 16:17:02 +08:00
* fix(renderer): defer uniform location retrieval and add view matrix in outline rendering * refactor(gameplay): encapsulate per-type vertex data into VertexData struct * feat(rendering): separate transparent blocks into discard and blend modes * feat(renderer): implement order-independent transparency * fix(shaders): reduce alpha discard threshold to 0.8
22 lines
421 B
GLSL
22 lines
421 B
GLSL
#version 460
|
|
|
|
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;
|
|
out float v_depth;
|
|
|
|
uniform mat4 mv_matrix;
|
|
uniform mat4 proj_matrix;
|
|
|
|
|
|
|
|
void main(void) {
|
|
vec4 view_pos = mv_matrix * vec4(pos, 1.0);
|
|
gl_Position = proj_matrix * view_pos;
|
|
tc = texCoord;
|
|
tex_layer = int(layer);
|
|
v_depth = -view_pos.z;
|
|
}
|