Created
July 29, 2023 17:22
-
-
Save otanodesignco/0eb85e1fea7a7e2309f758b2f02ac912 to your computer and use it in GitHub Desktop.
view direction
This file contains 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 characters
out vec3 vViewDirection; // varying to send to the fragment shader | |
void main() | |
{ | |
vec4 viewDirection = modelViewMatrix * vec4( position, 1.0 ); | |
vViewDirection = viewDirection.xyz; // set view direction per pixel | |
gl_Position = projectionMatrix * viewDirection; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment