Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1.  
  2. void main(){
  3.     //this is the fragment shader
  4.     //this is where the pixel level drawing happens
  5.     //gl_FragCoord gives us the x and y of the current pixel its drawing
  6.    
  7.     //we use the mod function to only draw pixels if they are every 2 in x or every 4 in y
  8.     if( mod(gl_FragCoord.x, 2.0) <= 0.5 && mod(gl_FragCoord.y, 4.0) <= 0.5 ){
  9.         gl_FragColor = gl_Color;    
  10.     }
  11.    
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement