89 lines
1.7 KiB
HLSL
89 lines
1.7 KiB
HLSL
////////////////////////////////////////////////////////////
|
|
//~ Quad shader types
|
|
|
|
Struct(V_QuadPSInput)
|
|
{
|
|
Vec4 Semantic(sv_position);
|
|
Vec2 Semantic(world_pos);
|
|
Vec2 Semantic(samp_uv);
|
|
nointerpolation V_Quad Semantic(quad);
|
|
};
|
|
|
|
Struct(V_QuadPSOutput)
|
|
{
|
|
Vec4 Semantic(sv_target0);
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Composite shader types
|
|
|
|
Struct(V_CompositePSInput)
|
|
{
|
|
Vec4 Semantic(sv_position);
|
|
};
|
|
|
|
Struct(V_CompositePSOutput)
|
|
{
|
|
Vec4 Semantic(sv_target0);
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Debug shape shader types
|
|
|
|
Struct(V_DVertPSInput)
|
|
{
|
|
Vec4 Semantic(sv_position);
|
|
Vec4 Semantic(color_lin);
|
|
};
|
|
|
|
Struct(V_DVertPSOutput)
|
|
{
|
|
Vec4 Semantic(sv_target0);
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Helpers
|
|
|
|
f32 V_RandFromPos(Vec3 pos);
|
|
Vec4 V_ColorFromParticle(V_ParticleDesc desc, u32 particle_idx, u32 density);
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Shaders
|
|
|
|
//- Build profiler graph
|
|
ComputeShader(V_ProfilerGraphCS);
|
|
|
|
//- Prepare frame
|
|
ComputeShader(V_PrepareShadeCS);
|
|
ComputeShader(V_PrepareCellsCS);
|
|
ComputeShader(V_ClearParticlesCS);
|
|
|
|
//- Backdrop
|
|
ComputeShader(V_BackdropDownCS);
|
|
ComputeShader(V_BackdropUpCS);
|
|
|
|
//- Quads
|
|
VertexShader(V_QuadVS, V_QuadPSInput);
|
|
PixelShader(V_QuadPS, V_QuadPSOutput, V_QuadPSInput input);
|
|
|
|
//- Particle simulation
|
|
ComputeShader(V_EmitParticlesCS);
|
|
ComputeShader(V_SimParticlesCS);
|
|
|
|
//- Shade
|
|
ComputeShader(V_ShadeCS);
|
|
|
|
//- Composite
|
|
ComputeShader(V_CompositeCS);
|
|
|
|
//- Bloom
|
|
ComputeShader(V_BloomDownCS);
|
|
ComputeShader(V_BloomUpCS);
|
|
|
|
//- Finalize
|
|
ComputeShader(V_FinalizeCS);
|
|
|
|
//- Debug shapes
|
|
VertexShader(V_DVertVS, V_DVertPSInput);
|
|
PixelShader(V_DVertPS, V_DVertPSOutput, V_DVertPSInput input);
|