58 lines
1.3 KiB
GLSL
58 lines
1.3 KiB
GLSL
// --- SET 0 --- GLOBAL --------------------------------------------------------
|
|
|
|
struct PointLight {
|
|
vec3 positionWS;
|
|
vec3 color;
|
|
};
|
|
|
|
struct DirectionalLight {
|
|
vec3 directionWS;
|
|
vec3 color;
|
|
};
|
|
|
|
struct Material {
|
|
vec3 baseColor;
|
|
uint baseColorTexture;
|
|
vec3 emissive;
|
|
uint emissiveTexture;
|
|
float ior;
|
|
float metallic;
|
|
float normalScale;
|
|
uint normalTexture;
|
|
uint occlusionRoughnessMetallicTexture;
|
|
float occlusionTextureStrength;
|
|
float roughness;
|
|
};
|
|
|
|
layout(set = 0, binding = 0, scalar) uniform GlobalUniforms {
|
|
mat4 matrixWStoVS;
|
|
mat4 matrixVStoCS;
|
|
vec3 ambientLight;
|
|
} _Global;
|
|
|
|
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 OBJECT ----------------------------------------------------
|
|
|
|
layout(set = 1, binding = 0, scalar) uniform ObjectUniforms {
|
|
mat4 matrixOStoWS;
|
|
mat4 matrixOStoWSNormal;
|
|
|
|
uint material;
|
|
} _Object;
|