Files
Seele/res/shaders/lib/StaticMeshVertexData.slang
T

25 lines
1.0 KiB
Plaintext
Raw Normal View History

2023-10-07 19:29:53 +02:00
import Common;
2023-11-08 23:27:21 +01:00
import VertexData;
import MaterialParameter;
2023-10-07 19:29:53 +02:00
2023-11-08 23:27:21 +01:00
struct StaticMeshVertexData : IVertexData
2023-10-07 19:29:53 +02:00
{
2023-11-27 21:08:27 +01:00
VertexAttributes getAttributes(uint index)
2023-10-07 19:29:53 +02:00
{
2023-11-09 22:15:51 +01:00
VertexAttributes attributes;
2023-11-27 21:08:27 +01:00
attributes.position_MS = float3(positions[3 * index + 0], positions[3 * index + 1], positions[3 * index + 2]);
2023-11-13 09:07:23 +01:00
attributes.normal_MS = float3(normals[3 * index + 0], normals[3 * index + 1], normals[3 * index + 2]);
attributes.tangent_MS = float3(tangents[3 * index + 0], tangents[3 * index + 1], tangents[3 * index + 2]);
attributes.biTangent_MS = float3(biTangents[3 * index + 0], biTangents[3 * index + 1], biTangents[3 * index + 2]);
2024-05-01 14:10:52 +02:00
attributes.texCoords[0] = float2(texCoords[2 * index + 0], texCoords[2 * index + 1]);
2023-11-13 09:07:23 +01:00
attributes.vertexColor = float3(color[3 * index + 0], color[3 * index + 1], color[3 * index + 2]);
2023-11-09 22:15:51 +01:00
return attributes;
2023-10-07 19:29:53 +02:00
}
2023-11-10 19:18:09 +01:00
StructuredBuffer<float> positions;
StructuredBuffer<float> texCoords;
StructuredBuffer<float> normals;
StructuredBuffer<float> tangents;
StructuredBuffer<float> biTangents;
2023-11-11 22:39:17 +01:00
StructuredBuffer<float> color;
2023-11-08 23:27:21 +01:00
};