normal compression makes shading look terrible

This commit is contained in:
Dynamitos
2025-01-29 16:29:58 +01:00
parent e5ac354527
commit 09660ab642
6 changed files with 84 additions and 80 deletions
+7 -6
View File
@@ -14,9 +14,10 @@ struct StaticMeshVertexData
VertexAttributes attributes;
attributes.position_MS = float3(positions[index * 3 + 0], positions[index * 3 + 1], positions[index * 3 + 2]);
#ifndef POS_ONLY
attributes.qTangent = qTangent[index];
//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]);
//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]);
for(uint i = 0; i < MAX_TEXCOORDS; ++i)
{
attributes.texCoords[i] = float2(uint16ToFloat(texCoords[i][index * 2 + 0]), uint16ToFloat(texCoords[i][index * 2 + 1]));
@@ -26,9 +27,9 @@ struct StaticMeshVertexData
return attributes;
}
StructuredBuffer<float> positions;
StructuredBuffer<float4> qTangent;
//StructuredBuffer<float> tangents;
//StructuredBuffer<float> biTangents;
StructuredBuffer<float> normals;
StructuredBuffer<float> tangents;
StructuredBuffer<float> biTangents;
StructuredBuffer<uint16_t> color;
StructuredBuffer<uint16_t> texCoords[MAX_TEXCOORDS];
};