summaryrefslogtreecommitdiffstats
path: root/shaders_inc/MarkRayMarchingSamples.fx.h
blob: 1a8510cc6c4f6d60c36a790f3cb168cbe7621d01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"// MarkRayMarchingSamples.fx\n"
"// Marks ray marching samples in the stencil by increasing stencil value and discarding all other samples\n"
"\n"
"#include \"AtmosphereShadersCommon.fxh\"\n"
"\n"
"Texture2D<uint2>  g_tex2DInterpolationSource;\n"
"\n"
"void MarkRayMarchingSamplesInStencilPS(FullScreenTriangleVSOutput VSOut\n"
"                                       // IMPORTANT: non-system generated pixel shader input\n"
"                                       // arguments must have the exact same name as vertex shader \n"
"                                       // outputs and must go in the same order.\n"
"                                       // Moreover, even if the shader is not using the argument,\n"
"                                       // it still must be declared.\n"
"                                       )\n"
"{\n"
"    uint2 ui2InterpolationSources = g_tex2DInterpolationSource.Load( int3(VSOut.f4PixelPos.xy,0) );\n"
"    // Ray marching samples are interpolated from themselves, so it is easy to detect them:\n"
"    if( ui2InterpolationSources.x != ui2InterpolationSources.y )\n"
"          discard;\n"
"}\n"