Skip to content

Commit e027545

Browse files
authored
Merge pull request #18317 from WestLangley/dev_common_glsl
Shaders: clarified method limitations
2 parents 6bf7f6c + 0d223a6 commit e027545

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/renderers/shaders/ShaderChunk/common.glsl.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
6363
6464
}
6565
66-
// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations
6766
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
6867
68+
// dir can be either a direction vector or a normal vector
69+
// upper-left 3x3 of matrix is assumed to be orthogonal
70+
6971
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
7072
7173
}

0 commit comments

Comments
 (0)