From 2e56645f1325383294a679a07f6e617cf7242b9c Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 7 Nov 2019 23:18:14 -0600 Subject: [PATCH] shifts spotlightparams to the actually used float2/vec2 entries (stops debug screaming every frame) --- Engine/source/lighting/lightManager.cpp | 2 +- Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 2 +- Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 2 +- Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl | 2 +- Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Engine/source/lighting/lightManager.cpp b/Engine/source/lighting/lightManager.cpp index 58f8016f6..57a1936f5 100644 --- a/Engine/source/lighting/lightManager.cpp +++ b/Engine/source/lighting/lightManager.cpp @@ -333,7 +333,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData, static AlignedArray lightSpotDirs(MAX_FORWARD_LIGHTS, sizeof(Point4F)); static AlignedArray lightColors(MAX_FORWARD_LIGHTS, sizeof(Point4F)); static AlignedArray lightConfigData(MAX_FORWARD_LIGHTS, sizeof(Point4F)); //type, brightness, range, invSqrRange : rgba - static AlignedArray lightSpotParams(MAX_FORWARD_LIGHTS, sizeof(Point4F)); + static AlignedArray lightSpotParams(MAX_FORWARD_LIGHTS, sizeof(Point2F)); dMemset(lightPositions.getBuffer(), 0, lightPositions.getBufferSize()); dMemset(lightSpotDirs.getBuffer(), 0, lightSpotDirs.getBufferSize()); diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 09c3e6c1f..946f0dac3 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2188,7 +2188,7 @@ void RTLightingFeatGLSL::processPix( Vector &componentList, inLightSpotDir->arraySize = 4; inLightSpotDir->constSortPos = cspPotentialPrimitive; - Var * lightSpotParams = new Var( "lightSpotParams", "vec4" ); + Var * lightSpotParams = new Var( "lightSpotParams", "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 070096097..6de962577 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -2234,7 +2234,7 @@ void RTLightingFeatHLSL::processPix( Vector &componentList, inLightSpotDir->arraySize = 4; inLightSpotDir->constSortPos = cspPotentialPrimitive; - Var * lightSpotParams = new Var( "lightSpotParams", "float4" ); + Var * lightSpotParams = new Var( "lightSpotParams", "float2" ); lightSpotParams->uniform = true; lightSpotParams->arraySize = 4; lightSpotParams->constSortPos = cspPotentialPrimitive; diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl index c95f8f764..68e30785b 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl @@ -241,7 +241,7 @@ vec4 compute4Lights( Surface surface, vec4 inLightConfigData[4], vec4 inLightColor[4], vec4 inLightSpotDir[4], - vec4 lightSpotParams[4], + vec2 lightSpotParams[4], int hasVectorLight, vec4 vectorLightDirection, vec4 vectorLightingColor, diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl index c371b87ce..8b372c149 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl @@ -247,7 +247,7 @@ float4 compute4Lights( Surface surface, float4 inLightConfigData[4], float4 inLightColor[4], float4 inLightSpotDir[4], - float4 lightSpotParams[4], + float2 lightSpotParams[4], int hasVectorLight, float4 vectorLightDirection, float4 vectorLightingColor,