diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-10-25 23:10:30 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-10-25 23:10:30 +0000 |
| commit | 0511d6e1858efecd8fc872e2cff8bd38caf7daae (patch) | |
| tree | 2a132fb76cb655e673eb19e8aabcc5be705fd0db /Source/Core/VideoCommon/Src/VertexShaderGen.cpp | |
| parent | 1adc944115c091661a2cb99f86c9707523766f84 (diff) | |
some work on zscale and zoffset, don't know if this is correct but at least it seem to fix one or two games.
thanks a lot to chaoscode he make possible to test this on nvidia. please test this a lot and give me feedback :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4468 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index a49f83a71e..bbd5a34f64 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -198,7 +198,7 @@ const char *GenerateVertexShader(u32 components, bool D3D) //"half3 norm2 = normalize(_norm2);\n"); } else { - WRITE(p, "float4 pos = float4(dot("I_POSNORMALMATRIX".T0, rawpos), dot("I_POSNORMALMATRIX".T1, rawpos), dot("I_POSNORMALMATRIX".T2, rawpos), 1);\n"); + WRITE(p, "float4 pos = float4(dot("I_POSNORMALMATRIX".T0, rawpos), dot("I_POSNORMALMATRIX".T1, rawpos), dot("I_POSNORMALMATRIX".T2, rawpos), 1.0f);\n"); if (components & VB_HAS_NRM0) WRITE(p, "half3 _norm0 = half3(dot("I_POSNORMALMATRIX".N0.xyz, rawnorm0), dot("I_POSNORMALMATRIX".N1.xyz, rawnorm0), dot("I_POSNORMALMATRIX".N2.xyz, rawnorm0));\n" "half3 norm0 = normalize(_norm0);\n"); @@ -243,7 +243,7 @@ const char *GenerateVertexShader(u32 components, bool D3D) if (components & (VB_HAS_COL0<<j) ) WRITE(p, "lacc = color%d;\n", j); else - WRITE(p, "lacc = half4(0.0f,0.0f,0.0f,0.0f);\n"); + WRITE(p, "lacc = half4(0,0,0,0);\n"); } else // from color WRITE(p, "lacc = "I_MATERIALS".C%d;\n", j); @@ -338,7 +338,7 @@ const char *GenerateVertexShader(u32 components, bool D3D) case XF_SRCNORMAL_INROW: if (components & VB_HAS_NRM0) { _assert_( texinfo.inputform == XF_TEXINPUT_ABC1 ); - WRITE(p, "float4 coord = float4(rawnorm0.xyz, 1.0);\n"); + WRITE(p, "float4 coord = float4(rawnorm0.xyz, 1.0f);\n"); } else WRITE(p, "float4 coord = float4(0.0f, 0.0f, 1.0f, 1.0f);\n"); // avoid errors break; @@ -348,14 +348,14 @@ const char *GenerateVertexShader(u32 components, bool D3D) case XF_SRCBINORMAL_T_INROW: if (components & VB_HAS_NRM1) { _assert_( texinfo.inputform == XF_TEXINPUT_ABC1 ); - WRITE(p, "float4 coord = float4(rawnorm1.xyz, 1.0);\n"); + WRITE(p, "float4 coord = float4(rawnorm1.xyz, 1.0f);\n"); } else WRITE(p, "float4 coord = float4(0.0f, 0.0f, 1.0f, 1.0f);\n"); // avoid errors break; case XF_SRCBINORMAL_B_INROW: if (components & VB_HAS_NRM2) { _assert_( texinfo.inputform == XF_TEXINPUT_ABC1 ); - WRITE(p, "float4 coord = float4(rawnorm2.xyz, 1.0);\n"); + WRITE(p, "float4 coord = float4(rawnorm2.xyz, 1.0f);\n"); } else WRITE(p, "float4 coord = float4(0.0f, 0.0f, 1.0f, 1.0f);\n"); // avoid errors break; @@ -479,7 +479,7 @@ char* GenerateLightShader(char* p, int index, const LitChannel& chan, const char WRITE(p, "attn = max(0.0f, dot("I_LIGHTS".lights[%d].cosatt.xyz, half3(1, attn, attn*attn))) / dot("I_LIGHTS".lights[%d].distatt.xyz, half3(1,dist,dist2));\n", index, index); } else if (chan.attnfunc == 1) { // specular - WRITE(p, "attn = dot(norm0, "I_LIGHTS".lights[%d].pos.xyz) > 0 ? max(0.0f, dot(norm0, "I_LIGHTS".lights[%d].dir.xyz)) : 0;\n", index, index); + WRITE(p, "attn = dot(norm0, "I_LIGHTS".lights[%d].pos.xyz) > 0.0f ? max(0.0f, dot(norm0, "I_LIGHTS".lights[%d].dir.xyz)) : 0.0f;\n", index, index); WRITE(p, "ldir = half3(1,attn,attn*attn);\n"); WRITE(p, "attn = max(0.0f, dot("I_LIGHTS".lights[%d].cosatt.xyz, ldir)) / dot("I_LIGHTS".lights[%d].distatt.xyz, ldir);\n", index, index); } |
