Files
FluidSimulation/res/shaders/Render.slang
T

32 lines
766 B
Plaintext

import Common;
import FluidGridData;
struct Params
{
StructuredBuffer<float> vertexBuffer;
StructuredBuffer<uint> indexBuffer;
};
ParameterBlock<Params> params;
struct VertexOut
{
float4 position : SV_Position;
};
[shader("vertex")]
VertexOut vertexMain(uint vertexId : SV_VertexID)
{
VertexOut output;
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));
return output;
}
[shader("pixel")]
float4 fragmentMain(VertexOut input) : SV_Target
{
return float4(0, 0, 1, 1);
}