voxelcore/res/shaders/shadows.glslv
lookibed 81489a13cf add block material shaders
- 'shader' property of block materials: shaders/materials/<name>.glslv, .glslf with material_vertex / material_fragment hooks and #param uniforms
- material shaders code is included into main, translucent and shadows programs through generated headers, no extra draw calls
- chunk vertex normal.w byte replaced with 'flags': bit 7 - emission flag, bits 0-6 - material shader index (vertex format size is not changed)
- doc/*/block-materials.md
2026-10-02 06:33:01 +03:00

22 lines
651 B
GLSL

#include <commons>
layout (location = 0) in vec3 v_position;
layout (location = 1) in vec2 v_texCoord;
layout (location = 2) in vec4 v_light;
layout (location = 3) in vec4 v_normal;
// same vertex stage interface as world shaders for material shaders
#include <world_vertex_header>
uniform float u_dayTime;
#include <__materials_vertex__>
void main() {
a_texCoord = v_texCoord;
a_material = unpack_material(v_normal.w);
a_realnormal = v_normal.xyz * 2.0 - 1.0;
a_modelpos = u_model * vec4(v_position, 1.0f);
a_modelpos.xyz = apply_material_vertex(a_material, a_modelpos.xyz);
gl_Position = u_proj * u_view * a_modelpos;
}