Skip to content

Commit 1618e74

Browse files
committed
use UV
1 parent 18af8f5 commit 1618e74

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/scripts/test.frag

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ varying vec3 vNormal;
33
varying vec2 vUv;
44

55
void main() {
6-
vec3 c = normalize(cameraPosition - vPosition);
7-
float fresnel = 1. - dot(c, vNormal);
6+
float fresnel = dot(normalize(cameraPosition - vPosition), vNormal);
87

9-
// gl_FragColor = vec4(c, 1.0);
10-
gl_FragColor = vec4(vec3(fresnel), 1.0);
8+
vec3 c = vec3(vUv.x, vUv.y, 1.);
9+
c -= 1. - vec3(fresnel);
10+
11+
// gl_FragColor = vec4(vUv, vec2(1., 1.));
12+
gl_FragColor = vec4(c.x, c.y, c.z, 1.);
1113
}

0 commit comments

Comments
 (0)