Guest User

Untitled

a guest
Dec 26th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #version 400
  2.  
  3. in vec3 pos;
  4. in float radius;
  5.  
  6. uniform mat4 mView;
  7. uniform mat4 projection;
  8. uniform vec2 screenSize;
  9.  
  10. out float thickness;
  11.  
  12. void main() {
  13.     //calculate normal
  14.     vec3 normal;
  15.     normal.xy = gl_PointCoord * 2.0 - 1.0;
  16.     float r2 = dot(normal.xy, normal.xy);
  17.    
  18.     if (r2 > 1.0f) {
  19.         discard;
  20.     }
  21.    
  22.     float nz = sqrt(1 - r2);
  23.    
  24.     //thickness = nz * 1.25 * 2.0f * exp(-r2 * 2.0f);
  25.     //thickness = 1 - r2;
  26.     //thickness = 1;
  27.     thickness = 0.5f;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment