From 50ccffd0a6a616423a69c0e328ca51fa476498aa Mon Sep 17 00:00:00 2001 From: hrydgard Date: Thu, 2 Jul 2009 23:16:30 +0000 Subject: [PATCH] OpenGL: Fix flickery crap graphics in Mario Galaxy. Was an uninitialized variable in the shader. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3654 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/VideoCommon/Src/VertexShaderGen.cpp | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index 2ee3857077..3208475ddf 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -219,11 +219,11 @@ const char *GenerateVertexShader(u32 components) } if (!(components & VB_HAS_NRM0)) - WRITE(p, "half3 _norm0 = half3(0,0,0), norm0= half3(0,0,0);\n"); + WRITE(p, "half3 _norm0 = half3(0,0,0), norm0 = half3(0,0,0);\n"); WRITE(p, "o.pos = float4(dot("I_PROJECTION".T0, pos), dot("I_PROJECTION".T1, pos), dot("I_PROJECTION".T2, pos), dot("I_PROJECTION".T3, pos));\n"); - WRITE(p, "half4 mat, lacc;\n" + WRITE(p, "half4 mat;\n" // = half4(1,1,1,1), lacc = half4(0,0,0,0);\n" "half3 ldir, h;\n" "half dist, dist2, attn;\n"); @@ -235,20 +235,23 @@ const char *GenerateVertexShader(u32 components) const LitChannel& alpha = xfregs.colChans[j].alpha; WRITE(p, "{\n"); - + + WRITE(p, "half4 lacc = half4(1,1,1,1);\n"); if (color.matsource) {// from vertex - if (components & (VB_HAS_COL0<