From 799d9e8cdfaa3e78c1fac86ac7c73ff72d04cf4f Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Mon, 19 Aug 2019 16:16:20 -0400 Subject: [PATCH] Changes in volume rendering for FXAA. --- shaders/framebuffer/raycastframebuffer.frag | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shaders/framebuffer/raycastframebuffer.frag b/shaders/framebuffer/raycastframebuffer.frag index 93c588bd4d..be6614e658 100644 --- a/shaders/framebuffer/raycastframebuffer.frag +++ b/shaders/framebuffer/raycastframebuffer.frag @@ -79,9 +79,6 @@ void main() { vec3 direction = normalize(diff); float raycastDepth = length(diff); - int i, j; - float tmp; - float geoDepth = denormalizeFloat(texelFetch(mainDepthTexture, ivec2(gl_FragCoord), 0).x); float geoRatio = clamp((geoDepth - entryDepth) / (exitDepth - entryDepth), 0.0, 1.0); raycastDepth = geoRatio * raycastDepth; @@ -102,11 +99,14 @@ void main() { vec3 accumulatedAlpha = vec3(0.0); - for (steps = 0; (accumulatedAlpha.r < ALPHA_LIMIT || accumulatedAlpha.g < ALPHA_LIMIT || - accumulatedAlpha.b < ALPHA_LIMIT) && steps < RAYCAST_MAX_STEPS; ++steps) { - if (currentDepth + nextStepSize * jitterFactor > raycastDepth) { - aaOpacity -= opacityDecay; - } + for (steps = 0; + (accumulatedAlpha.r < ALPHA_LIMIT || accumulatedAlpha.g < ALPHA_LIMIT || + accumulatedAlpha.b < ALPHA_LIMIT) && steps < RAYCAST_MAX_STEPS; + ++steps) + { + // if (currentDepth + nextStepSize * jitterFactor > raycastDepth) { + // aaOpacity -= opacityDecay; + // } bool shortStepSize = nextStepSize < raycastDepth / 10000000000.0; if (shortStepSize) {