82 lines
1.7 KiB
HLSL
82 lines
1.7 KiB
HLSL
////////////////////////////////////////////////////////////
|
|
//~ Quad shader types
|
|
|
|
Struct(V_QuadPSInput)
|
|
{
|
|
Semantic(Vec4, sv_position);
|
|
Semantic(nointerpolation u32, quad_idx);
|
|
Semantic(Vec2, world_pos);
|
|
Semantic(Vec2, samp_uv);
|
|
};
|
|
|
|
Struct(V_QuadPSOutput)
|
|
{
|
|
Semantic(Vec4, sv_target0);
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Composite shader types
|
|
|
|
Struct(V_CompositePSInput)
|
|
{
|
|
Semantic(Vec4, sv_position);
|
|
};
|
|
|
|
Struct(V_CompositePSOutput)
|
|
{
|
|
Semantic(Vec4, sv_target0);
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Debug shape shader types
|
|
|
|
Struct(V_DVertPSInput)
|
|
{
|
|
Semantic(Vec4, sv_position);
|
|
Semantic(Vec4, color_lin);
|
|
};
|
|
|
|
Struct(V_DVertPSOutput)
|
|
{
|
|
Semantic(Vec4, sv_target0);
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Helpers
|
|
|
|
f32 V_RandFromPos(Vec3 pos);
|
|
Vec4 V_ColorFromParticle(V_ParticleKind particle_kind, u32 particle_idx, u32 density, f32 dryness);
|
|
Vec3 V_ToneMap(Vec3 v);
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//~ Shaders
|
|
|
|
//- Utility shaders
|
|
ComputeShader2D(V_PrepareCellsCS, 8, 8);
|
|
ComputeShader(V_ClearParticlesCS, 64);
|
|
|
|
//- Quads
|
|
VertexShader(V_QuadVS, V_QuadPSInput);
|
|
PixelShader(V_QuadPS, V_QuadPSOutput, V_QuadPSInput input);
|
|
|
|
//- Particle simulation
|
|
ComputeShader(V_EmitParticlesCS, 64);
|
|
ComputeShader(V_SimParticlesCS, 64);
|
|
|
|
//- Shade
|
|
ComputeShader2D(V_ShadeCS, 8, 8);
|
|
|
|
//- Composite
|
|
ComputeShader2D(V_CompositeCS, 8, 8);
|
|
|
|
//- Bloom
|
|
ComputeShader2D(V_BloomDownCS, 8, 8);
|
|
ComputeShader2D(V_BloomUpCS, 8, 8);
|
|
|
|
//- Post process
|
|
ComputeShader2D(V_PostProcessCS, 8, 8);
|
|
|
|
//- Debug shapes
|
|
VertexShader(V_DVertVS, V_DVertPSInput);
|
|
PixelShader(V_DVertPS, V_DVertPSOutput, V_DVertPSInput input);
|