mirror of
https://github.com/BlueMap-Minecraft/BlueMapWeb.git
synced 2024-11-24 19:05:10 +01:00
Improve shader accuracy
This commit is contained in:
parent
c166518090
commit
daa6d02af9
@ -28,8 +28,8 @@ export const LOWRES_FRAGMENT_SHADER = `
|
|||||||
${ShaderChunk.logdepthbuf_pars_fragment}
|
${ShaderChunk.logdepthbuf_pars_fragment}
|
||||||
|
|
||||||
#define PI 3.1415926535897932
|
#define PI 3.1415926535897932
|
||||||
#define PI_HALF 1.5707963267948966
|
|
||||||
#define PI_D10 0.3141592653589793
|
#define PI_D10 0.3141592653589793
|
||||||
|
#define PI_D5 0.6283185307179586
|
||||||
|
|
||||||
#ifndef texture
|
#ifndef texture
|
||||||
#define texture texture2D
|
#define texture texture2D
|
||||||
@ -107,7 +107,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
occRGB += ao * 0.1;
|
occRGB += ao * 0.1;
|
||||||
|
|
||||||
color.rgb = mix(defaultRGB, occRGB, smoothstep(PI_HALF + PI_D10, PI - PI_D10, acos(clamp(viewMatrix[1][1] - 1.0, -1.0, 0.0))));
|
color.rgb = mix(defaultRGB, occRGB, smoothstep(PI - PI_D5, PI - PI_D10, acos(-clamp(viewMatrix[1][2], 0.0, 1.0))));
|
||||||
} else {
|
} else {
|
||||||
color.rgb = defaultRGB;
|
color.rgb = defaultRGB;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user