From 6a152e86298502e587da4744c9f5bfab1d0ddf81 Mon Sep 17 00:00:00 2001 From: numzero Date: Sun, 2 Apr 2023 21:19:58 +0300 Subject: [PATCH] OpenGL3: Drop unused material property uniforms --- media/Shaders/Solid.vsh | 7 ------- source/Irrlicht/OpenGL/FixedPipelineRenderer.cpp | 9 ++------- source/Irrlicht/OpenGL/FixedPipelineRenderer.h | 7 ------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/media/Shaders/Solid.vsh b/media/Shaders/Solid.vsh index 98d0daef..c260409b 100644 --- a/media/Shaders/Solid.vsh +++ b/media/Shaders/Solid.vsh @@ -14,13 +14,6 @@ uniform mat4 uWVMatrix; uniform mat4 uNMatrix; uniform mat4 uTMatrix0; -uniform vec4 uGlobalAmbient; -uniform vec4 uMaterialAmbient; -uniform vec4 uMaterialDiffuse; -uniform vec4 uMaterialEmissive; -uniform vec4 uMaterialSpecular; -uniform float uMaterialShininess; - uniform float uThickness; /* Varyings */ diff --git a/source/Irrlicht/OpenGL/FixedPipelineRenderer.cpp b/source/Irrlicht/OpenGL/FixedPipelineRenderer.cpp index 421788ac..004e2574 100644 --- a/source/Irrlicht/OpenGL/FixedPipelineRenderer.cpp +++ b/source/Irrlicht/OpenGL/FixedPipelineRenderer.cpp @@ -15,7 +15,7 @@ namespace video // Base callback COpenGL3MaterialBaseCB::COpenGL3MaterialBaseCB() : - FirstUpdateBase(true), WVPMatrixID(-1), WVMatrixID(-1), NMatrixID(-1), GlobalAmbientID(-1), MaterialAmbientID(-1), MaterialDiffuseID(-1), MaterialEmissiveID(-1), MaterialSpecularID(-1), MaterialShininessID(-1), + FirstUpdateBase(true), WVPMatrixID(-1), WVMatrixID(-1), NMatrixID(-1), FogEnableID(-1), FogTypeID(-1), FogColorID(-1), FogStartID(-1), FogEndID(-1), FogDensityID(-1), ThicknessID(-1), LightEnable(false), MaterialAmbient(SColorf(0.f, 0.f, 0.f)), MaterialDiffuse(SColorf(0.f, 0.f, 0.f)), MaterialEmissive(SColorf(0.f, 0.f, 0.f)), MaterialSpecular(SColorf(0.f, 0.f, 0.f)), MaterialShininess(0.f), FogEnable(0), FogType(1), FogColor(SColorf(0.f, 0.f, 0.f, 1.f)), FogStart(0.f), FogEnd(0.f), FogDensity(0.f), Thickness(1.f) @@ -45,12 +45,7 @@ void COpenGL3MaterialBaseCB::OnSetConstants(IMaterialRendererServices* services, WVPMatrixID = services->getVertexShaderConstantID("uWVPMatrix"); WVMatrixID = services->getVertexShaderConstantID("uWVMatrix"); NMatrixID = services->getVertexShaderConstantID("uNMatrix"); - GlobalAmbientID = services->getVertexShaderConstantID("uGlobalAmbient"); - MaterialAmbientID = services->getVertexShaderConstantID("uMaterialAmbient"); - MaterialDiffuseID = services->getVertexShaderConstantID("uMaterialDiffuse"); - MaterialEmissiveID = services->getVertexShaderConstantID("uMaterialEmissive"); - MaterialSpecularID = services->getVertexShaderConstantID("uMaterialSpecular"); - MaterialShininessID = services->getVertexShaderConstantID("uMaterialShininess"); + FogEnableID = services->getVertexShaderConstantID("uFogEnable"); FogTypeID = services->getVertexShaderConstantID("uFogType"); FogColorID = services->getVertexShaderConstantID("uFogColor"); diff --git a/source/Irrlicht/OpenGL/FixedPipelineRenderer.h b/source/Irrlicht/OpenGL/FixedPipelineRenderer.h index cfbb3b66..9613d20b 100644 --- a/source/Irrlicht/OpenGL/FixedPipelineRenderer.h +++ b/source/Irrlicht/OpenGL/FixedPipelineRenderer.h @@ -28,13 +28,6 @@ protected: s32 WVMatrixID; s32 NMatrixID; - s32 GlobalAmbientID; - s32 MaterialAmbientID; - s32 MaterialDiffuseID; - s32 MaterialEmissiveID; - s32 MaterialSpecularID; - s32 MaterialShininessID; - s32 FogEnableID; s32 FogTypeID; s32 FogColorID;