| 1 |
|
| 2 |
layout(set = 0, binding = 0) uniform BakeParameters { |
| 3 |
vec3 world_size; |
| 4 |
float bias; |
| 5 |
|
| 6 |
vec3 to_cell_offset; |
| 7 |
int grid_size; |
| 8 |
|
| 9 |
vec3 to_cell_size; |
| 10 |
uint light_count; |
| 11 |
|
| 12 |
mat3x4 env_transform; |
| 13 |
|
| 14 |
ivec2 atlas_size; |
| 15 |
float exposure_normalization; |
| 16 |
uint bounces; |
| 17 |
|
| 18 |
float bounce_indirect_energy; |
| 19 |
int shadowmask_light_idx; |
| 20 |
uint transparency_rays; |
| 21 |
float supersampling_factor; |
| 22 |
} |
| 23 |
bake_params; |
| 24 |
|
| 25 |
struct Vertex { |
| 26 |
vec3 position; |
| 27 |
float normal_z; |
| 28 |
vec2 uv; |
| 29 |
vec2 normal_xy; |
| 30 |
}; |
| 31 |
|
| 32 |
layout(set = 0, binding = 1, std430) restrict readonly buffer Vertices { |
| 33 |
Vertex data[]; |
| 34 |
} |
| 35 |
vertices; |
| 36 |
|
| 37 |
#define CULL_DISABLED 0 |
| 38 |
#define CULL_FRONT 1 |
| 39 |
#define CULL_BACK 2 |
| 40 |
|
| 41 |
struct Triangle { |
| 42 |
uvec3 indices; |
| 43 |
uint slice; |
| 44 |
vec3 min_bounds; |
| 45 |
uint cull_mode; |
| 46 |
vec3 max_bounds; |
| 47 |
uint pad1; |
| 48 |
}; |
| 49 |
|
| 50 |
struct ClusterAABB { |
| 51 |
vec3 min_bounds; |
| 52 |
uint pad0; |
| 53 |
vec3 max_bounds; |
| 54 |
uint pad1; |
| 55 |
}; |
| 56 |
|
| 57 |
layout(set = 0, binding = 2, std430) restrict readonly buffer Triangles { |
| 58 |
Triangle data[]; |
| 59 |
} |
| 60 |
triangles; |
| 61 |
|
| 62 |
layout(set = 0, binding = 3, std430) restrict readonly buffer TriangleIndices { |
| 63 |
uint data[]; |
| 64 |
} |
| 65 |
triangle_indices; |
| 66 |
|
| 67 |
#define LIGHT_TYPE_DIRECTIONAL 0 |
| 68 |
#define LIGHT_TYPE_OMNI 1 |
| 69 |
#define LIGHT_TYPE_SPOT 2 |
| 70 |
|
| 71 |
struct Light { |
| 72 |
vec3 position; |
| 73 |
uint type; |
| 74 |
|
| 75 |
vec3 direction; |
| 76 |
float energy; |
| 77 |
|
| 78 |
vec3 color; |
| 79 |
float size; |
| 80 |
|
| 81 |
float range; |
| 82 |
float attenuation; |
| 83 |
float cos_spot_angle; |
| 84 |
float inv_spot_attenuation; |
| 85 |
|
| 86 |
float indirect_energy; |
| 87 |
float shadow_blur; |
| 88 |
bool static_bake; |
| 89 |
uint pad; |
| 90 |
}; |
| 91 |
|
| 92 |
layout(set = 0, binding = 4, std430) restrict readonly buffer Lights { |
| 93 |
Light data[]; |
| 94 |
} |
| 95 |
lights; |
| 96 |
|
| 97 |
struct Seam { |
| 98 |
uvec2 a; |
| 99 |
uvec2 b; |
| 100 |
}; |
| 101 |
|
| 102 |
layout(set = 0, binding = 5, std430) restrict readonly buffer Seams { |
| 103 |
Seam data[]; |
| 104 |
} |
| 105 |
seams; |
| 106 |
|
| 107 |
layout(set = 0, binding = 6, std430) restrict readonly buffer Probes { |
| 108 |
vec4 data[]; |
| 109 |
} |
| 110 |
probe_positions; |
| 111 |
|
| 112 |
layout(set = 0, binding = 7) uniform utexture3D grid; |
| 113 |
|
| 114 |
layout(set = 0, binding = 8) uniform texture2DArray albedo_tex; |
| 115 |
layout(set = 0, binding = 9) uniform texture2DArray emission_tex; |
| 116 |
|
| 117 |
layout(set = 0, binding = 10) uniform sampler linear_sampler; |
| 118 |
|
| 119 |
layout(set = 0, binding = 11, std430) restrict readonly buffer ClusterIndices { |
| 120 |
uint data[]; |
| 121 |
} |
| 122 |
cluster_indices; |
| 123 |
|
| 124 |
layout(set = 0, binding = 12, std430) restrict readonly buffer ClusterAABBs { |
| 125 |
ClusterAABB data[]; |
| 126 |
} |
| 127 |
cluster_aabbs; |
| 128 |
|
| 129 |
// Fragment action constants |
| 130 |
const uint FA_NONE = 0; |
| 131 |
const uint FA_SMOOTHEN_POSITION = 1; |