Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #version 330 core
  2. // for snow rendering
  3. layout (location = 0) in vec3 aPos;
  4.  
  5. uniform mat4 model;
  6. uniform mat4 view;
  7. uniform mat4 projection;
  8.  
  9. void main()
  10. {
  11. gl_Position = projection * view * model * vec4(aPos, 1.0);
  12. }
  13.  
  14. #version 330
  15. out vec4 FragColor;
  16.  
  17. uniform sampler3D volumeData;
  18.  
  19. void main()
  20. {
  21. ivec3 size = textureSize(volumeData, 0);
  22. float c = texture3D(volumeData, vec3(0)).x;
  23. if (size.x == 1)
  24. FragColor = vec4(1.0, 0.0, c, 1.0);
  25. else if (size.x > 2)
  26. FragColor = vec4(0.0, 1.0, 0.0, 1.0);
  27. else if (size.x == 0)
  28. FragColor = vec4(0.0, 0.0, 1.0, 1.0);
  29. else
  30. FragColor = vec4(1.0, 1.0, 1.0, 1.0);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement