59 lines
1.3 KiB
GLSL
59 lines
1.3 KiB
GLSL
// --- SET 0 --- GLOBAL --------------------------------------------------------
|
|
|
|
struct PointLight {
|
|
vec3 positionWS;
|
|
vec3 color;
|
|
};
|
|
|
|
struct DirectionalLight {
|
|
vec3 directionWS;
|
|
vec3 color;
|
|
};
|
|
|
|
struct Material {
|
|
vec3 baseColor;
|
|
vec3 emissive;
|
|
float ior;
|
|
float metallic;
|
|
float normalScale;
|
|
float occlusionTextureStrength;
|
|
float roughness;
|
|
|
|
uint16_t baseColorTexture;
|
|
uint16_t emissiveTexture;
|
|
uint16_t normalTexture;
|
|
uint16_t occlusionRoughnessMetallicTexture;
|
|
};
|
|
|
|
struct ObjectUniforms {
|
|
mat4 matrixOStoWS;
|
|
mat4 matrixOStoWSNormal;
|
|
|
|
uint16_t material;
|
|
};
|
|
|
|
#include "global_uniforms.glsl"
|
|
|
|
layout(set = 0, binding = 1, scalar) readonly buffer PointLights {
|
|
uint count;
|
|
PointLight lights[];
|
|
} _PointLights;
|
|
|
|
layout(set = 0, binding = 2, scalar) readonly buffer DirectionalLights {
|
|
uint count;
|
|
DirectionalLight lights[];
|
|
} _DirectionalLights;
|
|
|
|
layout(set = 0, binding = 3, scalar) readonly buffer Materials {
|
|
Material _Materials[];
|
|
};
|
|
|
|
layout(set = 0, binding = 4) uniform sampler _Sampler;
|
|
layout(set = 0, binding = 5) uniform texture2D _Textures[];
|
|
|
|
// --- SET 1 --- PER BATCH -----------------------------------------------------
|
|
|
|
layout(set = 1, binding = 0, scalar) readonly buffer ObjectsUniforms {
|
|
ObjectUniforms _Object[];
|
|
};
|