Created
August 30, 2020 09:48
-
-
Save faultyagatha/336d8ab1fc5c6f0ac7687756fa18e920 to your computer and use it in GitHub Desktop.
Revisions
-
faultyagatha created this gist
Aug 30, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ /* in fragment shader, using derivatives extension enabled */ //vertex: vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); vViewPos = mvPosition.xyz; //pass to the fragment shader //fragment: vec3 X = dFdx(vViewPos); vec3 Y = dFdy(vViewPos); vec3 normal = normalize(cross(X, Y));