Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. vec3 gl330_normalize(vec3 at)
  2. {
  3. float dist = sqrt(pow(at.x, 2) + pow(at.y, 2) + pow(at.z, 2));
  4. at.x /= dist;
  5. at.y /= dist;
  6. at.z /= dist;
  7. return at;
  8. }
  9.  
  10.  
  11. void main()
  12. {
  13. vec4 result = sky_projection * vec4(in_xyz, 1.0);
  14. result.x /= result.w;
  15. result.y /= result.w;
  16. result.z /= result.w;
  17.  
  18. result.xyz = gl330_normalize(result.xyz);
  19.  
  20. color = vec4(0,1,0,1);
  21. color = vec4(1.0,0.0,0.0,1.0);
  22. color.y = result.y/2+0.5;
  23. // color.xyz = result.xyz/2 + 0.5;// sky(result.xyz);
  24.  
  25. //gl_FragDepth = 1.0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement