From 5be18a4638121951bde2825a02b162ff5cf89cdb Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 6 Jun 2022 17:50:34 -0500 Subject: [PATCH] allow ambient light injection into ibl --- .../shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl | 3 ++- .../shaders/lighting/advanced/reflectionProbeArrayP.hlsl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl index 813597c95..6ab0a8f18 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl @@ -12,6 +12,7 @@ uniform sampler2D colorBuffer; uniform sampler2D matInfoBuffer; uniform sampler2D BRDFTexture; +uniform vec4 ambientColor; uniform vec4 rtParams0; uniform vec4 vsFarPlane; uniform mat4 cameraToWorld; @@ -202,6 +203,6 @@ void main() #if CAPTURING == 1 OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0); #else - OUT_col = vec4((irradiance + specular* horizon) , 0);//alpha writes disabled + OUT_col = vec4((irradiance + specular* horizon)*ambientColor.rgb , 0);//alpha writes disabled #endif } diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl index d9314329e..b649843f3 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -8,7 +8,7 @@ TORQUE_UNIFORM_SAMPLER2D(deferredBuffer, 0); TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 1); TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 2); TORQUE_UNIFORM_SAMPLER2D(BRDFTexture, 3); - +uniform float4 ambientColor; uniform float4 rtParams0; uniform float4 vsFarPlane; uniform float4x4 cameraToWorld; @@ -190,6 +190,6 @@ float4 main(PFXVertToPix IN) : SV_TARGET #if CAPTURING == 1 return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0); #else - return float4((irradiance + specular* horizon) , 0);//alpha writes disabled + return float4((irradiance + specular* horizon)*ambientColor.rgb, 0);//alpha writes disabled #endif }