Skip to content

Commit ced0567

Browse files
committed
Update normal-codec-pars.frag
1 parent 06c067d commit ced0567

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/shader-chunks/shaders/normal-codec-pars.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*
44
* @see https://knarkowicz.wordpress.com/2014/04/16/octahedron-normal-vector-encoding/
55
* @see https://aras-p.info/texts/CompactNormalStorage.html
6+
* @see https://x.com/Stubbesaurus/status/937994790553227264
67
*/
78

89
vec2 pp_encodeNormal(vec3 n) {
@@ -15,7 +16,6 @@ vec2 pp_encodeNormal(vec3 n) {
1516

1617
vec3 pp_decodeNormal(vec2 f) {
1718

18-
// https://twitter.com/Stubbesaurus/status/937994790553227264
1919
vec3 n = vec3(f.x, f.y, 1.0 - abs(f.x) - abs(f.y));
2020
float t = clamp(-n.z, 0.0, 1.0);
2121
n.xy += vec2(n.x >= 0.0 ? -t : t, n.y >= 0.0 ? -t : t);

0 commit comments

Comments
 (0)