Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///VERTEX SHADER
- #version 330
- uniform mat4 transformationMatrix;
- uniform mat4 projectionMatrix;
- uniform mat4 viewMatrix;
- void main(){
- vec4 worldPosition = transformationMatrix * vec4(gl_Position.xyz, 1.0);
- vec4 positionRelativeToCam = viewMatrix * worldPosition;
- gl_Position = projectionMatrix * positionRelativeToCam;
- }
- //FRAGMENT SHADER
- #version 330
- uniform vec4 color;
- void main(){
- gl_FragColor = color;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement