Added way to set global light from game.
+ Some clean up in the mesh renderer
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,19 +21,21 @@ cbuffer RootConstants : register(b0, space0)
|
||||
uint TransformsBufferIndex;
|
||||
uint BufferIndex;
|
||||
uint TextureIndex;
|
||||
uint VertexOffset; // Base vertex for indexed drawing with bindless buffers
|
||||
uint _Padding; // Padding for alignment
|
||||
float2 Scale; // 2D scale factor
|
||||
float2 Translate; // 2D translation
|
||||
float2 _Padding2; // Explicit padding to align LightDirection to 16 bytes
|
||||
|
||||
float3 GlobalLightDirection; // Normalized, world-space
|
||||
float GlobalLightPad;
|
||||
float3 GlobalLightColor;
|
||||
float GlobalAmbientIntensity;
|
||||
|
||||
uint VertexOffset; // Base vertex for indexed drawing with bindless buffers
|
||||
uint LightBufferIndex;
|
||||
uint ActiveLightCount;
|
||||
float GlobalAmbientIntensity;
|
||||
|
||||
float3 GlobalLightDirection; // Normalized, world-space
|
||||
uint _Pad1;
|
||||
|
||||
float3 GlobalLightColor;
|
||||
uint _Pad2;
|
||||
|
||||
float2 Scale; // 2D scale factor
|
||||
float2 Translate; // 2D translation
|
||||
|
||||
float4 MeshAlbedo;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ Output main(uint vertexIndex : SV_VertexID)
|
||||
|
||||
float4 worldPos = mul(Model, float4(pos, 1.0f));
|
||||
output.Position = mul(ViewProjection, worldPos);
|
||||
output.Color = col;
|
||||
output.Color = col * MeshAlbedo;
|
||||
output.WorldPosition = worldPos.xyz;
|
||||
|
||||
float3 worldNormal = mul((float3x3)Model, normal);
|
||||
|
||||
Reference in New Issue
Block a user