From 0718875ac3d1db0646f890cd853b29bef1201e28 Mon Sep 17 00:00:00 2001 From: LuisAntonRebollo Date: Thu, 11 Dec 2014 22:58:02 +0100 Subject: [PATCH] OpenGL Intel - Fix a error on DOF_DownSample_P.glsl. --- .../game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl | 5 ++++- .../game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl index 6b7cf4eca..17f23e487 100644 --- a/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl +++ b/Templates/Empty/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl @@ -84,13 +84,16 @@ void main() // The CoC will be 1 if the depth is negative, so use "min" to pick // between "sceneCoc" and "viewCoc". + coc = half4(0); for ( int i = 0; i < 4; i++ ) { depth[0] = prepassUncondition( depthSampler, ( IN_tcDepth0.xy + rowOfs[i] ) ).w; depth[1] = prepassUncondition( depthSampler, ( IN_tcDepth1.xy + rowOfs[i] ) ).w; depth[2] = prepassUncondition( depthSampler, ( IN_tcDepth2.xy + rowOfs[i] ) ).w; depth[3] = prepassUncondition( depthSampler, ( IN_tcDepth3.xy + rowOfs[i] ) ).w; - coc[i] = clamp( dofEqWorld.x * depth + dofEqWorld.y, 0.0, maxWorldCoC ); + + // @todo OPENGL INTEL need review + coc = max( coc, clamp( half4(dofEqWorld.x) * depth + half4(dofEqWorld.y), half4(0.0), half4(maxWorldCoC) ) ); } /* diff --git a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl index 6b7cf4eca..17f23e487 100644 --- a/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl +++ b/Templates/Full/game/shaders/common/postFx/dof/gl/DOF_DownSample_P.glsl @@ -84,13 +84,16 @@ void main() // The CoC will be 1 if the depth is negative, so use "min" to pick // between "sceneCoc" and "viewCoc". + coc = half4(0); for ( int i = 0; i < 4; i++ ) { depth[0] = prepassUncondition( depthSampler, ( IN_tcDepth0.xy + rowOfs[i] ) ).w; depth[1] = prepassUncondition( depthSampler, ( IN_tcDepth1.xy + rowOfs[i] ) ).w; depth[2] = prepassUncondition( depthSampler, ( IN_tcDepth2.xy + rowOfs[i] ) ).w; depth[3] = prepassUncondition( depthSampler, ( IN_tcDepth3.xy + rowOfs[i] ) ).w; - coc[i] = clamp( dofEqWorld.x * depth + dofEqWorld.y, 0.0, maxWorldCoC ); + + // @todo OPENGL INTEL need review + coc = max( coc, clamp( half4(dofEqWorld.x) * depth + half4(dofEqWorld.y), half4(0.0), half4(maxWorldCoC) ) ); } /*