We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18af8f5 commit 1618e74Copy full SHA for 1618e74
src/scripts/test.frag
@@ -3,9 +3,11 @@ varying vec3 vNormal;
3
varying vec2 vUv;
4
5
void main() {
6
- vec3 c = normalize(cameraPosition - vPosition);
7
- float fresnel = 1. - dot(c, vNormal);
+ float fresnel = dot(normalize(cameraPosition - vPosition), vNormal);
8
9
- // gl_FragColor = vec4(c, 1.0);
10
- gl_FragColor = vec4(vec3(fresnel), 1.0);
+ vec3 c = vec3(vUv.x, vUv.y, 1.);
+ c -= 1. - vec3(fresnel);
+
11
+ // gl_FragColor = vec4(vUv, vec2(1., 1.));
12
+ gl_FragColor = vec4(c.x, c.y, c.z, 1.);
13
}
0 commit comments