Starting to integrate mesh optimizer

This commit is contained in:
Dynamitos
2025-05-12 22:48:01 +02:00
parent 10f2a9235b
commit f873d6db26
21 changed files with 446 additions and 288 deletions
+2
View File
@@ -59,6 +59,8 @@ ConstantBuffer<DrawCallOffsets> pOffsets;
struct Scene
{
StructuredBuffer<float> positions;
StructuredBuffer<uint> indexBuffer;
StructuredBuffer<InstanceData> instances;
StructuredBuffer<MeshData> meshData;
StructuredBuffer<MeshletDescription> meshletInfos;
+2 -2
View File
@@ -1,6 +1,7 @@
import Common;
import VertexData;
import MaterialParameter;
import Scene;
struct StaticMeshVertexData : IVertexData
{
@@ -12,7 +13,7 @@ struct StaticMeshVertexData : IVertexData
VertexAttributes getAttributes(uint index)
{
VertexAttributes attributes;
attributes.position_MS = float3(positions[index * 3 + 0], positions[index * 3 + 1], positions[index * 3 + 2]);
attributes.position_MS = float3(pScene.positions[index * 3 + 0], pScene.positions[index * 3 + 1], pScene.positions[index * 3 + 2]);
#ifndef POS_ONLY
//attributes.qTangent = qTangent[index];
attributes.normal_MS = float3(normals[index * 3 + 0], normals[index * 3 + 1], normals[index * 3 + 2]);
@@ -26,7 +27,6 @@ struct StaticMeshVertexData : IVertexData
#endif
return attributes;
}
StructuredBuffer<float> positions;
//StructuredBuffer<float> qTangents;
StructuredBuffer<float> normals;
StructuredBuffer<float> tangents;