Files
FluidSimulation/res/shaders/Render.slang
T

32 lines
766 B
Plaintext
Raw Normal View History

2026-04-11 10:15:50 +02:00
import Common;
2026-04-06 09:55:59 +02:00
import FluidGridData;
struct Params
{
2026-04-11 10:15:50 +02:00
StructuredBuffer<float> vertexBuffer;
StructuredBuffer<uint> indexBuffer;
2026-04-06 09:55:59 +02:00
};
ParameterBlock<Params> params;
struct VertexOut
{
float4 position : SV_Position;
};
[shader("vertex")]
VertexOut vertexMain(uint vertexId : SV_VertexID)
{
VertexOut output;
2026-04-11 10:15:50 +02:00
uint index = params.indexBuffer[vertexId];
float3 vertex = float3(params.vertexBuffer[index * 3 + 0],
params.vertexBuffer[index * 3 + 1],
params.vertexBuffer[index * 3 + 2]) * 5;
output.position = mul(pViewParams.viewProjectionMatrix, float4(vertex, 1));
2026-04-06 09:55:59 +02:00
return output;
}
[shader("pixel")]
float4 fragmentMain(VertexOut input) : SV_Target
{
2026-04-11 10:15:50 +02:00
return float4(0, 0, 1, 1);
2026-04-06 09:55:59 +02:00
}