Begin new Asset Pipeline
This commit is contained in:
57
assets/shaders/main_common.glsl
Normal file
57
assets/shaders/main_common.glsl
Normal file
@@ -0,0 +1,57 @@
|
||||
// --- 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) uniform sampler _Sampler;
|
||||
layout(set = 0, binding = 4) uniform texture2D _Textures[];
|
||||
|
||||
layout(set = 0, binding = 5, scalar) readonly buffer Materials {
|
||||
Material _Materials[];
|
||||
};
|
||||
|
||||
// --- SET 1 --- PER OBJECT ----------------------------------------------------
|
||||
|
||||
layout(set = 1, binding = 0, scalar) uniform ObjectUniforms {
|
||||
mat4 matrixOStoWS;
|
||||
mat4 matrixOStoWSNormal;
|
||||
|
||||
uint material;
|
||||
} _Object;
|
||||
Reference in New Issue
Block a user