From a05c83493e3e69cd68622167ec8ae172c87aee6a Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 21 Oct 2021 22:08:56 -0500 Subject: [PATCH] adress gl spotlights disapearing for deferred It was mixing vars up between it and forward. resolved by prefixing the forward vars with "in" as the rest are, as well as pointing the val at the const String ShaderGenVars::lightSpotParams("$inlightSpotParams"); --- Engine/source/lighting/shadowMap/lightShadowMap.cpp | 2 +- Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 2 +- Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 2 +- Engine/source/shaderGen/shaderGenVars.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Engine/source/lighting/shadowMap/lightShadowMap.cpp b/Engine/source/lighting/shadowMap/lightShadowMap.cpp index 3fde1ccbf..9ecde8c97 100644 --- a/Engine/source/lighting/shadowMap/lightShadowMap.cpp +++ b/Engine/source/lighting/shadowMap/lightShadowMap.cpp @@ -470,7 +470,6 @@ void LightingShaderConstants::init(GFXShader* shader) } mLightParamsSC = shader->getShaderConstHandle("$lightParams"); - mLightSpotParamsSC = shader->getShaderConstHandle("$lightSpotParams"); // NOTE: These are the shader constants used for doing lighting // during the forward pass. Do not confuse these for the deferred @@ -480,6 +479,7 @@ void LightingShaderConstants::init(GFXShader* shader) mLightAmbientSC = shader->getShaderConstHandle( ShaderGenVars::lightAmbient ); mLightConfigDataSC = shader->getShaderConstHandle( ShaderGenVars::lightConfigData); mLightSpotDirSC = shader->getShaderConstHandle( ShaderGenVars::lightSpotDir ); + mLightSpotParamsSC = shader->getShaderConstHandle(ShaderGenVars::lightSpotParams); mHasVectorLightSC = shader->getShaderConstHandle(ShaderGenVars::hasVectorLight); mVectorLightDirectionSC = shader->getShaderConstHandle(ShaderGenVars::vectorLightDirection); diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index bb09113a4..3c132bf55 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2189,7 +2189,7 @@ void RTLightingFeatGLSL::processPix( Vector &componentList, inLightSpotDir->arraySize = 4; inLightSpotDir->constSortPos = cspPotentialPrimitive; - Var * lightSpotParams = new Var( "lightSpotParams", "vec2" ); + Var * lightSpotParams = new Var( "inlightSpotParams", "vec2" ); lightSpotParams->uniform = true; lightSpotParams->arraySize = 4; lightSpotParams->constSortPos = cspPotentialPrimitive; diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index 0b5f79e4d..48a20d835 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -2262,7 +2262,7 @@ void RTLightingFeatHLSL::processPix( Vector &componentList, inLightSpotDir->arraySize = 4; inLightSpotDir->constSortPos = cspPotentialPrimitive; - Var * lightSpotParams = new Var( "lightSpotParams", "float2" ); + Var * lightSpotParams = new Var( "inlightSpotParams", "float2" ); lightSpotParams->uniform = true; lightSpotParams->arraySize = 4; lightSpotParams->constSortPos = cspPotentialPrimitive; diff --git a/Engine/source/shaderGen/shaderGenVars.cpp b/Engine/source/shaderGen/shaderGenVars.cpp index 45d1fe7f2..6a933319d 100644 --- a/Engine/source/shaderGen/shaderGenVars.cpp +++ b/Engine/source/shaderGen/shaderGenVars.cpp @@ -66,7 +66,7 @@ const String ShaderGenVars::lightDiffuse("$inLightColor"); const String ShaderGenVars::lightAmbient("$ambient"); const String ShaderGenVars::lightConfigData("$inLightConfigData"); const String ShaderGenVars::lightSpotDir("$inLightSpotDir"); -const String ShaderGenVars::lightSpotParams("$lightSpotParams"); +const String ShaderGenVars::lightSpotParams("$inlightSpotParams"); const String ShaderGenVars::hasVectorLight("$hasVectorLight"); const String ShaderGenVars::vectorLightDirection("$vectorLightDirection");