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

30 lines
802 B
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;
2024-06-13 22:47:51 +02:00
attributes.position_MS = positions[index].xyz;
2024-06-19 10:33:19 +02:00
#ifndef POS_ONLY
2024-06-13 22:47:51 +02:00
attributes.normal_MS = normals[index].xyz;
attributes.tangent_MS = tangents[index].xyz;
attributes.biTangent_MS = biTangents[index].xyz;
2024-05-06 18:36:16 +02:00
for(uint i = 0; i < MAX_TEXCOORDS; ++i)
{
2024-06-13 22:47:51 +02:00
attributes.texCoords[i] = texCoords[i][index];
2024-05-06 18:36:16 +02:00
}
2024-06-13 22:47:51 +02:00
attributes.vertexColor = color[index].xyz;
2024-06-19 10:33:19 +02:00
#endif
2023-11-09 22:15:51 +01:00
return attributes;
2023-10-07 19:29:53 +02:00
}
2024-06-13 22:47:51 +02:00
StructuredBuffer<float4> positions;
StructuredBuffer<float4> normals;
StructuredBuffer<float4> tangents;
StructuredBuffer<float4> biTangents;
StructuredBuffer<float4> color;
StructuredBuffer<float2> texCoords[MAX_TEXCOORDS];
2023-11-08 23:27:21 +01:00
};