Refactored Effects + start of EngineBuffers (I hate it)

This commit is contained in:
Simon Lübeß
2022-06-07 13:12:03 +02:00
parent a80018e80c
commit 866353a157
16 changed files with 282 additions and 217 deletions
+1 -1
View File
@@ -13,4 +13,4 @@ uint PS(float4 input : SV_Position) : SV_Target0
return ClearValue;
}
#effect[VS = VS, PS = PS]
#pragma Effect[VS = VS; PS = PS]
@@ -30,4 +30,4 @@ float4 PS(PS_IN input) : SV_TARGET
return float4(pow(color.rgb, 1.0f / 2.2f), color.a);
}
#effect[VS = VS, PS = PS]
#pragma Effect[VS = VS; PS = PS]
@@ -32,4 +32,4 @@ float4 PS(PS_IN input) : SV_TARGET
return float4(color, 1);
}
#effect[VS = VS, PS = PS]
#pragma Effect[VS = VS; PS = PS]
@@ -59,4 +59,4 @@ float4 PS(PS_Input input) : SV_Target0
return color;
}
#effect[VS=VS, PS=PS]
#pragma Effect[VS=VS; PS=PS]
@@ -28,4 +28,4 @@ float4 PS(PS_Input input) : SV_Target0
return Color;
}
#effect[VS=VS, PS=PS]
#pragma Effect[VS=VS; PS=PS]
@@ -90,4 +90,4 @@ float4 PS(PS_Input input) : SV_Target0
}
*/
#effect[VS=VS, PS=PS]
#pragma Effect[VS=VS; PS=PS]
+10 -8
View File
@@ -17,12 +17,14 @@ SamplerState RoughnessSampler : register(s3);
// Texture2D<float> AmbientTexture : register(t4);
// SamplerState AmbientSampler : register(s4);
cbuffer SceneConstants
#pragma EngineBuffer[ Name = "SceneConstants"; Binding = "Scene" ]
cbuffer SceneConstants : register(b0)
{
float4x4 ViewProjection;
}
cbuffer ObjectConstants
#pragma EngineBuffer[ Name = "ObjectConstants"; Binding = "Object" ]
cbuffer ObjectConstants : register(b1)
{
float4x4 Transform;
/**
@@ -35,15 +37,15 @@ cbuffer ObjectConstants
#endif
}
cbuffer Constants
cbuffer MaterialConstants : register(b2)
{
#EditorVariable{ Name = "AlbedoColor"; Preview = "Albedo Color"; Type="Color" }
#pragma EditorVariable[ Name = "AlbedoColor"; Preview = "Albedo Color"; Type="Color" ]
float4 AlbedoColor = float4(1.0, 1.0, 1.0, 1.0);
#EditorVariable{ Name = "NormalScaling"; Preview = "Normal Scaling" }
#pragma EditorVariable[ Name = "NormalScaling"; Preview = "Normal Scaling" ]
float2 NormalScaling = float2(1.0, 1.0);
#EditorVariable{ Name = "MetallicFactor"; Preview = "Metallic Factor"; Min = 0.0f; Max = 1.0f }
#pragma EditorVariable[ Name = "MetallicFactor"; Preview = "Metallic Factor"; Min = 0.0f; Max = 1.0f ]
float MetallicFactor = 1.0;
#EditorVariable{ Name = "RoughnessFactor"; Preview = "Rougness Factor"; Min = 0.0f; Max = 1.0f }
#pragma EditorVariable[ Name = "RoughnessFactor"; Preview = "Rougness Factor"; Min = 0.0f; Max = 1.0f ]
float RoughnessFactor = 1.0;
// float AmbientFactor = 1.0;
}
@@ -154,4 +156,4 @@ PS_OUT PS(PS_IN input)
return output;
}
#effect[VS=VS,PS=PS]
#pragma Effect[VS = VS; PS = PS]
@@ -123,4 +123,4 @@ float4 PS(PS_IN input) : SV_TARGET
return float4(final, 1);
}
#effect[VS=VS,PS=PS]
#pragma Effect[VS = VS; PS = PS]
@@ -71,4 +71,4 @@ PS_Output PS(PS_Input input)
return output;
}
#effect[VS=VS, PS=PS]
#pragma Effect[VS = VS; PS = PS]
@@ -49,4 +49,4 @@ float4 PS(PS_Input input) : SV_Target0
return final;
}
#effect[VS=VS, PS=PS]
#pragma Effect[VS=VS; PS=PS]