From ee1a489dc7d41ca0133d237fd44217f2ad6a9988 Mon Sep 17 00:00:00 2001 From: rogerman Date: Fri, 31 Jul 2015 20:46:00 +0000 Subject: [PATCH] =?UTF-8?q?OpenGL=20Renderer:=20-=20Change=20toon=20highli?= =?UTF-8?q?ght=20blending=20to=20match=20SoftRasterizer.=20Fixes=20the=20?= =?UTF-8?q?=E2=80=9CShadows=20of=20Almia=E2=80=9D=20logo=20in=20the=20Poke?= =?UTF-8?q?mon=20Ranger:=20Shadows=20of=20Almia=20title=20screen.=20(Addre?= =?UTF-8?q?sses=20one=20of=20the=20issues=20noted=20in=20bug=20#1253.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desmume/src/OGLRender.cpp | 2 +- desmume/src/OGLRender_3_2.cpp | 2 +- desmume/src/rasterize.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index b931887f8..5909c7ab1 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -317,7 +317,7 @@ static const char *fragmentShader_100 = {"\ else if(polyMode == 2) \n\ { \n\ vec3 toonColor = vec3(texture1D(texToonTable, vtxColor.r).rgb); \n\ - newFragColor.rgb = (stateToonShadingMode == 0) ? mainTexColor.rgb * toonColor.rgb : min((mainTexColor.rgb * vtxColor.rgb) + toonColor.rgb, 1.0); \n\ + newFragColor.rgb = (stateToonShadingMode == 0) ? mainTexColor.rgb * toonColor.rgb : min((mainTexColor.rgb * vtxColor.r) + toonColor.rgb, 1.0); \n\ } \n\ else if(polyMode == 3) \n\ { \n\ diff --git a/desmume/src/OGLRender_3_2.cpp b/desmume/src/OGLRender_3_2.cpp index 148680123..b42884526 100644 --- a/desmume/src/OGLRender_3_2.cpp +++ b/desmume/src/OGLRender_3_2.cpp @@ -211,7 +211,7 @@ static const char *GeometryFragShader_150 = {"\ else if (polyMode == 2u) \n\ { \n\ vec3 newToonColor = state.toonColor[int((vtxColor.r * 31.0) + 0.5)].rgb;\n\ - newFragColor.rgb = (state.toonShadingMode == 0) ? mainTexColor.rgb * newToonColor.rgb : min((mainTexColor.rgb * vtxColor.rgb) + newToonColor.rgb, 1.0); \n\ + newFragColor.rgb = (state.toonShadingMode == 0) ? mainTexColor.rgb * newToonColor.rgb : min((mainTexColor.rgb * vtxColor.r) + newToonColor.rgb, 1.0); \n\ } \n\ else if (polyMode == 3u) \n\ { \n\ diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index 586af13c7..6a71ab8c5 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -532,6 +532,7 @@ public: if (gfx3d.renderState.shading == GFX3D_State::HIGHLIGHT) { + // Tested in the "Shadows of Almia" logo in the Pokemon Ranger: Shadows of Almia title screen. dst.r = modulate_table[mainTexColor.r][src.r]; dst.g = modulate_table[mainTexColor.g][src.r]; dst.b = modulate_table[mainTexColor.b][src.r];