You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Gridmap/scenes/3DWorld.gdshader

28 lines
548 B

shader_type spatial;
render_mode world_vertex_coords, cull_disabled, vertex_lighting;
uniform float CURVATURE;
uniform float CURVATURE_ACTIVE;
uniform float CURVATURE_DISTANCE;
uniform sampler2D BASE_TEX;
void vertex() {
if(CURVATURE_ACTIVE == 1.0) {
NORMAL = (MODEL_MATRIX * vec4(NORMAL, 0.0)).xyz;
float dist = length(VIEW_MATRIX[3].xyz - VERTEX) / CURVATURE_DISTANCE;
VERTEX.y -= pow(dist, CURVATURE);
}
}
void fragment() {
vec4 tex = texture(BASE_TEX, UV);
if(tex.a < 0.3) {
discard;
}
ALBEDO = tex.rgb;
ALPHA = tex.a;
}