voxelcore/res/shaders/shadows.glslf
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

15 lines
309 B
GLSL

#include <world_fragment_header>
uniform sampler2D u_texture0;
#include <__materials_fragment__>
void main() {
vec4 tex_color = apply_material_fragment(
a_material, texture(u_texture0, a_texCoord)
);
if (tex_color.a < 0.5) {
discard;
}
// depth will be written anyway
}