Added normals to vertexdata
This commit is contained in:
1 parent
f98be3c7f3
commit
1e1ec84fa1
5 files changed
+41
-53
No files matched your search
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
struct Output
|
||||
{
|
||||
float4 Color : TEXCOORD0;
|
||||
float3 Normal : TEXCOORD1;
|
||||
float4 Position : SV_Position;
|
||||
};
|
||||
|
||||
@@ -12,14 +13,16 @@ Output main(uint vertexIndex : SV_VertexID)
|
||||
|
||||
ByteAddressBuffer buffer = ResourceDescriptorHeap[BufferIndex];
|
||||
|
||||
uint stride = 28;
|
||||
uint stride = 40;
|
||||
uint offset = vertexIndex * stride;
|
||||
|
||||
float3 pos = asfloat(buffer.Load3(offset));
|
||||
float4 col = asfloat(buffer.Load4(offset + 12));
|
||||
float3 normal = asfloat(buffer.Load3(offset + 12));
|
||||
float4 col = asfloat(buffer.Load4(offset + 24));
|
||||
|
||||
//output.Position = float4(pos, 1.0f);
|
||||
output.Position = mul(ViewProjection, mul(Model, float4(pos, 1.0f)));
|
||||
output.Color = col;
|
||||
output.Normal = normal;
|
||||
return output;
|
||||
}
|
||||
Reference in new issue
Block a user