From eea35600d3092bcb3564f53fd95846172fd837e8 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Fri, 4 Nov 2022 14:04:59 +0800 Subject: [PATCH] Switched shaders to use multiply colour instead of additive --- Assets/Shaders/TestCube_FS.glsl | 2 +- Assets/Shaders/TestCube_FS.shshaderb | Bin 2401 -> 2401 bytes SHADE_Application/src/Scenes/SBTestScene.cpp | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Shaders/TestCube_FS.glsl b/Assets/Shaders/TestCube_FS.glsl index 1d2b156d..d6f88687 100644 --- a/Assets/Shaders/TestCube_FS.glsl +++ b/Assets/Shaders/TestCube_FS.glsl @@ -43,7 +43,7 @@ void main() { position = In.vertPos; normals = In.normal; - albedo = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv) + MatProp.data[In2.materialIndex].color; + albedo = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv) * MatProp.data[In2.materialIndex].color; outEntityID = In2.eid; lightLayerIndices = In2.lightLayerIndex; diff --git a/Assets/Shaders/TestCube_FS.shshaderb b/Assets/Shaders/TestCube_FS.shshaderb index 01bf616394dc1f3cad2a9274e76a1966e373ca4b..bcf5bf5ec1c14753c2ee4942289ea98261360a16 100644 GIT binary patch delta 13 UcmaDT^iXKSO%BG^$+tM#0W0wZ`Tzg` delta 13 UcmaDT^iXKSO%BG!$+tM#0V~}F_5c6? diff --git a/SHADE_Application/src/Scenes/SBTestScene.cpp b/SHADE_Application/src/Scenes/SBTestScene.cpp index b840bed3..fa5d7868 100644 --- a/SHADE_Application/src/Scenes/SBTestScene.cpp +++ b/SHADE_Application/src/Scenes/SBTestScene.cpp @@ -67,7 +67,7 @@ namespace Sandbox // Create Materials auto baseRaccoonMat = graphicsSystem->AddOrGetBaseMaterialInstance(); auto baseRaccoonMatInstant = graphicsSystem->AddMaterialInstanceCopy(baseRaccoonMat); - baseRaccoonMatInstant->SetProperty("data.color", SHVec4(0.0f, 0.0f, 0.0f, 1.0f)); + baseRaccoonMatInstant->SetProperty("data.color", SHVec4(1.0f, 1.0f, 1.0f, 1.0f)); baseRaccoonMatInstant->SetProperty("data.textureIndex", 0); baseRaccoonMatInstant->SetProperty("data.alpha", 0.1f); @@ -189,7 +189,7 @@ namespace Sandbox renderableShowcase.SetMesh(handles.front()); renderableShowcase.SetMaterial(baseRaccoonMatInstant); - renderableShowcase.GetModifiableMaterial()->SetProperty("data.color", SHVec4(0.0f, 0.0f, 0.0f, 0.0f)); + renderableShowcase.GetModifiableMaterial()->SetProperty("data.color", SHVec4(1.0f, 1.0f, 1.0f, 1.0f)); renderableShowcase.GetModifiableMaterial()->SetProperty("data.alpha", 1.0f); renderableShowcase.GetModifiableMaterial()->SetProperty("data.textureIndex", 0);