spes/General/S_TestGridWS.gdshader

18 lines
419 B
Plaintext
Raw Permalink Normal View History

2023-08-21 01:43:22 +00:00
shader_type spatial;
render_mode skip_vertex_transform;
varying vec3 world_pos;
uniform sampler2D albedo : source_color,filter_nearest_mipmap_anisotropic;
void vertex() {
world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
NORMAL = normalize((MODELVIEW_MATRIX * vec4(NORMAL, 0.0)).xyz);
}
void fragment() {
ALBEDO = texture(albedo, world_pos.xz).xyz;
}