Einige Bug Fixes (Camera, Thumbnails), Terrain
This commit is contained in:
@@ -96,4 +96,17 @@ void main() {
|
||||
#else
|
||||
outColor = vec4(col.rgb * light * BRIGHTNESS + vec3(spec * 0.35), col.a);
|
||||
#endif
|
||||
|
||||
#ifdef SHOW_GRID
|
||||
vec2 fw = fwidth(vWorldPos.xz);
|
||||
float maxFw = max(fw.x, fw.y);
|
||||
float fade = 1.0 - smoothstep(0.2, 0.6, maxFw);
|
||||
if (fade > 0.0) {
|
||||
vec2 gp = fract(vWorldPos.xz);
|
||||
vec2 d = min(gp, 1.0 - gp);
|
||||
float ga = 1.0 - min(smoothstep(0.0, max(fw.x, 0.005), d.x),
|
||||
smoothstep(0.0, max(fw.y, 0.005), d.y));
|
||||
outColor.rgb = mix(outColor.rgb, vec3(0.5), ga * fade * 0.5);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user