From bf10d48287917271a87ac2e43a91bdc84e457a43 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 18 Apr 2019 19:31:33 -0500 Subject: [PATCH] specify lod (mip) 0 for the brdf texture --- .../lighting/advanced/gl/reflectionProbeArrayP.glsl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeArrayP.glsl b/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeArrayP.glsl index aeb89678b..c8e17b422 100644 --- a/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeArrayP.glsl +++ b/Templates/Full/game/shaders/common/lighting/advanced/gl/reflectionProbeArrayP.glsl @@ -171,10 +171,10 @@ void main() float cubemapIdx = probeConfigData[i].a; vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], bbMinArray[i].xyz, bbMaxArray[i].xyz, inRefPosArray[i].xyz); - //irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib; - //specular += textureLod(specularCubemapAR, vec4(dir, cubemapIdx), lod).xyz * contrib; - irradiance += vec3(1,1,1) * contrib; - specular += vec3(1,1,1) * contrib; + irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib; + specular += textureLod(specularCubemapAR, vec4(dir, cubemapIdx), lod).xyz * contrib; + //irradiance += vec3(1,1,1) * contrib; + //specular += vec3(1,1,1) * contrib; alpha -= contrib; } } @@ -201,7 +201,7 @@ void main() //apply brdf //Do it once to save on texture samples - vec2 brdf = texture(BRDFTexture, vec2(surface.roughness, surface.NdotV)).xy; + vec2 brdf = textureLod(BRDFTexture, vec2(surface.roughness, surface.NdotV),0).xy; specular *= brdf.x * F + brdf.y; //final diffuse color