mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-06-15 11:44:07 +03:00
For FSAA mode we now store the depth values from first sample in myRaytraceFBO1 and do not modify it while collecting the rest of samples. When all samples are gathered we fetch color from myRaytraceFBO2 and depth from myRaytraceFBO1 and display it to the current FBO. Test bugs vis bug27337 added.
30 lines
576 B
GLSL
30 lines
576 B
GLSL
//! Input image.
|
|
uniform sampler2D uInputTexture;
|
|
|
|
//! Ray tracing depth image.
|
|
uniform sampler2D uDepthTexture;
|
|
|
|
//! Gamma correction flag.
|
|
uniform int uApplyGamma;
|
|
|
|
//! Output pixel color.
|
|
out vec4 OutColor;
|
|
|
|
void main (void)
|
|
{
|
|
vec4 aColor = texelFetch (uInputTexture, ivec2 (gl_FragCoord.xy), 0);
|
|
|
|
float aDepth = texelFetch (uDepthTexture, ivec2 (gl_FragCoord.xy), 0).r;
|
|
gl_FragDepth = aDepth;
|
|
|
|
if (uApplyGamma == 1)
|
|
{
|
|
// apply gamma correction (we use gamma = 2)
|
|
OutColor = vec4 (sqrt (aColor.rgb), aColor.a);
|
|
}
|
|
else
|
|
{
|
|
OutColor = aColor;
|
|
}
|
|
}
|