mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
refactor: transparent render (#14)
* 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
This commit is contained in:
21
assets/shaders/block_accumulation_v_shader.glsl
Normal file
21
assets/shaders/block_accumulation_v_shader.glsl
Normal file
@@ -0,0 +1,21 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user