Formalize forward lighting contract
This commit is contained in:
@@ -8,15 +8,18 @@ layout(std140, binding = 0) uniform PerObjectConstants {
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
};
|
||||
|
||||
layout(std140, binding = 1) uniform LightingConstants {
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(std140, binding = 1) uniform MaterialConstants {
|
||||
layout(std140, binding = 2) uniform MaterialConstants {
|
||||
vec4 gBaseColorFactor;
|
||||
};
|
||||
|
||||
layout(std140, binding = 2) uniform ShadowReceiverConstants {
|
||||
layout(std140, binding = 3) uniform ShadowReceiverConstants {
|
||||
mat4 gWorldToShadowMatrix;
|
||||
vec4 gShadowBiasAndTexelSize;
|
||||
vec4 gShadowOptions;
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
// XC_BUILTIN_FORWARD_LIT_VULKAN_PS
|
||||
#version 450
|
||||
layout(set = 2, binding = 0) uniform texture2D uBaseColorTexture;
|
||||
layout(set = 3, binding = 0) uniform sampler uLinearSampler;
|
||||
layout(set = 5, binding = 0) uniform texture2D uShadowMapTexture;
|
||||
layout(set = 6, binding = 0) uniform sampler uShadowMapSampler;
|
||||
layout(set = 4, binding = 0) uniform texture2D uBaseColorTexture;
|
||||
layout(set = 5, binding = 0) uniform sampler uLinearSampler;
|
||||
layout(set = 6, binding = 0) uniform texture2D uShadowMapTexture;
|
||||
layout(set = 7, binding = 0) uniform sampler uShadowMapSampler;
|
||||
|
||||
layout(set = 0, binding = 0, std140) uniform PerObjectConstants {
|
||||
mat4 gProjectionMatrix;
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
};
|
||||
|
||||
layout(set = 1, binding = 0, std140) uniform LightingConstants {
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(set = 1, binding = 0, std140) uniform MaterialConstants {
|
||||
layout(set = 2, binding = 0, std140) uniform MaterialConstants {
|
||||
vec4 gBaseColorFactor;
|
||||
};
|
||||
|
||||
layout(set = 4, binding = 0, std140) uniform ShadowReceiverConstants {
|
||||
layout(set = 3, binding = 0, std140) uniform ShadowReceiverConstants {
|
||||
mat4 gWorldToShadowMatrix;
|
||||
vec4 gShadowBiasAndTexelSize;
|
||||
vec4 gShadowOptions;
|
||||
|
||||
@@ -9,15 +9,18 @@ cbuffer PerObjectConstants : register(b0) {
|
||||
float4x4 gViewMatrix;
|
||||
float4x4 gModelMatrix;
|
||||
float4x4 gNormalMatrix;
|
||||
};
|
||||
|
||||
cbuffer LightingConstants : register(b1) {
|
||||
float4 gMainLightDirectionAndIntensity;
|
||||
float4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
cbuffer MaterialConstants : register(b1) {
|
||||
cbuffer MaterialConstants : register(b2) {
|
||||
float4 gBaseColorFactor;
|
||||
};
|
||||
|
||||
cbuffer ShadowReceiverConstants : register(b2) {
|
||||
cbuffer ShadowReceiverConstants : register(b3) {
|
||||
float4x4 gWorldToShadowMatrix;
|
||||
float4 gShadowBiasAndTexelSize;
|
||||
float4 gShadowOptions;
|
||||
|
||||
@@ -14,12 +14,13 @@ Shader "Builtin Forward Lit"
|
||||
Resources
|
||||
{
|
||||
PerObjectConstants (ConstantBuffer, 0, 0) [Semantic(PerObject)]
|
||||
MaterialConstants (ConstantBuffer, 1, 0) [Semantic(Material)]
|
||||
BaseColorTexture (Texture2D, 2, 0) [Semantic(BaseColorTexture)]
|
||||
LinearClampSampler (Sampler, 3, 0) [Semantic(LinearClampSampler)]
|
||||
ShadowReceiverConstants (ConstantBuffer, 4, 0) [Semantic(ShadowReceiver)]
|
||||
ShadowMapTexture (Texture2D, 5, 0) [Semantic(ShadowMapTexture)]
|
||||
ShadowMapSampler (Sampler, 6, 0) [Semantic(ShadowMapSampler)]
|
||||
LightingConstants (ConstantBuffer, 1, 0) [Semantic(Lighting)]
|
||||
MaterialConstants (ConstantBuffer, 2, 0) [Semantic(Material)]
|
||||
ShadowReceiverConstants (ConstantBuffer, 3, 0) [Semantic(ShadowReceiver)]
|
||||
BaseColorTexture (Texture2D, 4, 0) [Semantic(BaseColorTexture)]
|
||||
LinearClampSampler (Sampler, 5, 0) [Semantic(LinearClampSampler)]
|
||||
ShadowMapTexture (Texture2D, 6, 0) [Semantic(ShadowMapTexture)]
|
||||
ShadowMapSampler (Sampler, 7, 0) [Semantic(ShadowMapSampler)]
|
||||
}
|
||||
HLSLPROGRAM
|
||||
#pragma vertex MainVS
|
||||
|
||||
@@ -9,8 +9,6 @@ layout(std140, binding = 0) uniform PerObjectConstants {
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
out vec3 vNormalWS;
|
||||
|
||||
@@ -9,8 +9,6 @@ layout(set = 0, binding = 0, std140) uniform PerObjectConstants {
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(location = 0) out vec3 vNormalWS;
|
||||
|
||||
@@ -4,8 +4,6 @@ cbuffer PerObjectConstants : register(b0) {
|
||||
float4x4 gViewMatrix;
|
||||
float4x4 gModelMatrix;
|
||||
float4x4 gNormalMatrix;
|
||||
float4 gMainLightDirectionAndIntensity;
|
||||
float4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
struct VSInput {
|
||||
|
||||
@@ -7,8 +7,6 @@ layout(std140, binding = 0) uniform PerObjectConstants {
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(std140, binding = 1) uniform MaterialConstants {
|
||||
|
||||
@@ -8,8 +8,6 @@ layout(set = 0, binding = 0, std140) uniform PerObjectConstants {
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(set = 1, binding = 0, std140) uniform MaterialConstants {
|
||||
|
||||
@@ -7,8 +7,6 @@ cbuffer PerObjectConstants : register(b0) {
|
||||
float4x4 gViewMatrix;
|
||||
float4x4 gModelMatrix;
|
||||
float4x4 gNormalMatrix;
|
||||
float4 gMainLightDirectionAndIntensity;
|
||||
float4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
cbuffer MaterialConstants : register(b1) {
|
||||
|
||||
@@ -9,8 +9,6 @@ layout(std140, binding = 0) uniform PerObjectConstants {
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
out vec2 vTexCoord;
|
||||
|
||||
@@ -9,8 +9,6 @@ layout(set = 0, binding = 0, std140) uniform PerObjectConstants {
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
mat4 gNormalMatrix;
|
||||
vec4 gMainLightDirectionAndIntensity;
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(location = 0) out vec2 vTexCoord;
|
||||
|
||||
@@ -4,8 +4,6 @@ cbuffer PerObjectConstants : register(b0) {
|
||||
float4x4 gViewMatrix;
|
||||
float4x4 gModelMatrix;
|
||||
float4x4 gNormalMatrix;
|
||||
float4 gMainLightDirectionAndIntensity;
|
||||
float4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
struct VSInput {
|
||||
|
||||
Reference in New Issue
Block a user