|
@@ -221,12 +221,17 @@ Reflector.ReflectorShader = {
|
|
|
uniform mat4 textureMatrix;
|
|
|
varying vec4 vUv;
|
|
|
|
|
|
+ #include <common>
|
|
|
+ #include <logdepthbuf_pars_vertex>
|
|
|
+
|
|
|
void main() {
|
|
|
|
|
|
vUv = textureMatrix * vec4( position, 1.0 );
|
|
|
|
|
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
|
|
|
|
+ #include <logdepthbuf_vertex>
|
|
|
+
|
|
|
}`,
|
|
|
|
|
|
fragmentShader: /* glsl */`
|
|
@@ -234,6 +239,8 @@ Reflector.ReflectorShader = {
|
|
|
uniform sampler2D tDiffuse;
|
|
|
varying vec4 vUv;
|
|
|
|
|
|
+ #include <logdepthbuf_pars_fragment>
|
|
|
+
|
|
|
float blendOverlay( float base, float blend ) {
|
|
|
|
|
|
return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );
|
|
@@ -248,6 +255,8 @@ Reflector.ReflectorShader = {
|
|
|
|
|
|
void main() {
|
|
|
|
|
|
+ #include <logdepthbuf_fragment>
|
|
|
+
|
|
|
vec4 base = texture2DProj( tDiffuse, vUv );
|
|
|
gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );
|
|
|
|