basic sponza import

This commit is contained in:
Dynamitos
2025-03-31 11:39:17 +02:00
parent 7a3aa482c7
commit 4a34220cd7
10 changed files with 51 additions and 44 deletions
+4 -3
View File
@@ -16,8 +16,9 @@ struct StaticMeshVertexData
#ifndef POS_ONLY
//attributes.qTangent = qTangent[index];
attributes.normal_MS = float3(normals[index * 3 + 0], normals[index * 3 + 1], normals[index * 3 + 2]);
attributes.tangent_MS = float3(tangents[index * 3 + 0], tangents[index * 3 + 1], tangents[index * 3 + 2]);
attributes.biTangent_MS = float3(biTangents[index * 3 + 0], biTangents[index * 3 + 1], biTangents[index * 3 + 2]);
float4 tangentSign = float4(tangents[index * 4 + 0], tangents[index * 4 + 1], tangents[index * 4 + 2], tangents[index * 4 + 3]);
attributes.tangent_MS = tangentSign.xyz;
attributes.biTangent_MS = cross(attributes.normal_MS, attributes.tangent_MS) * -tangentSign.w;
for(uint i = 0; i < MAX_TEXCOORDS; ++i)
{
attributes.texCoords[i] = float2(uint16ToFloat(texCoords[i][index * 2 + 0]), uint16ToFloat(texCoords[i][index * 2 + 1]));
@@ -27,9 +28,9 @@ struct StaticMeshVertexData
return attributes;
}
StructuredBuffer<float> positions;
//StructuredBuffer<float> qTangents;
StructuredBuffer<float> normals;
StructuredBuffer<float> tangents;
StructuredBuffer<float> biTangents;
StructuredBuffer<uint16_t> color;
StructuredBuffer<uint16_t> texCoords[MAX_TEXCOORDS];
};