lm_common_inc.glsl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* SET 0, static data that does not change between any call */
  2. struct Vertex {
  3. vec3 position;
  4. float normal_z;
  5. vec2 uv;
  6. vec2 normal_xy;
  7. };
  8. layout(set = 0, binding = 1, std430) restrict readonly buffer Vertices {
  9. Vertex data[];
  10. }
  11. vertices;
  12. struct Triangle {
  13. uvec3 indices;
  14. uint slice;
  15. };
  16. layout(set = 0, binding = 2, std430) restrict readonly buffer Triangles {
  17. Triangle data[];
  18. }
  19. triangles;
  20. struct Box {
  21. vec3 min_bounds;
  22. uint pad0;
  23. vec3 max_bounds;
  24. uint pad1;
  25. };
  26. layout(set = 0, binding = 3, std430) restrict readonly buffer Boxes {
  27. Box data[];
  28. }
  29. boxes;
  30. layout(set = 0, binding = 4, std430) restrict readonly buffer GridIndices {
  31. uint data[];
  32. }
  33. grid_indices;
  34. #define LIGHT_TYPE_DIRECTIONAL 0
  35. #define LIGHT_TYPE_OMNI 1
  36. #define LIGHT_TYPE_SPOT 2
  37. struct Light {
  38. vec3 position;
  39. uint type;
  40. vec3 direction;
  41. float energy;
  42. vec3 color;
  43. float size;
  44. float range;
  45. float attenuation;
  46. float cos_spot_angle;
  47. float inv_spot_attenuation;
  48. bool static_bake;
  49. uint pad[3];
  50. };
  51. layout(set = 0, binding = 5, std430) restrict readonly buffer Lights {
  52. Light data[];
  53. }
  54. lights;
  55. struct Seam {
  56. uvec2 a;
  57. uvec2 b;
  58. };
  59. layout(set = 0, binding = 6, std430) restrict readonly buffer Seams {
  60. Seam data[];
  61. }
  62. seams;
  63. layout(set = 0, binding = 7, std430) restrict readonly buffer Probes {
  64. vec4 data[];
  65. }
  66. probe_positions;
  67. layout(set = 0, binding = 8) uniform utexture3D grid;
  68. layout(set = 0, binding = 9) uniform texture3D grid_sdf;
  69. layout(set = 0, binding = 10) uniform texture2DArray albedo_tex;
  70. layout(set = 0, binding = 11) uniform texture2DArray emission_tex;
  71. layout(set = 0, binding = 12) uniform sampler linear_sampler;