spes/Planetside/Environment/S_TestGrid.gdshader

18 lines
419 B
Plaintext

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;
}