mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Change comparison in specular light function. Fixes issue 1258.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6505 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
1f660de7e5
commit
f91ac92895
@ -26,7 +26,7 @@
|
||||
// shader cache for every revision, graphics-related or not, which is simply annoying.
|
||||
enum
|
||||
{
|
||||
LINEAR_DISKCACHE_VER = 6504
|
||||
LINEAR_DISKCACHE_VER = 6505
|
||||
};
|
||||
|
||||
// On disk format:
|
||||
|
@ -415,7 +415,7 @@ char *GeneratePixelLightShader(char *p, int index, const LitChannel& chan, const
|
||||
else if (chan.attnfunc == 1)
|
||||
{ // specular
|
||||
WRITE(p, "ldir = normalize("I_PLIGHTS".lights[%d].pos.xyz);\n",index);
|
||||
WRITE(p, "attn = (dot(_norm0,ldir) > 0.0f) ? max(0.0f, dot(_norm0, "I_PLIGHTS".lights[%d].dir.xyz)) : 0.0f;\n", index);
|
||||
WRITE(p, "attn = (dot(_norm0,ldir) >= 0.0f) ? max(0.0f, dot(_norm0, "I_PLIGHTS".lights[%d].dir.xyz)) : 0.0f;\n", index);
|
||||
WRITE(p, "attn = max(0.0f, dot("I_PLIGHTS".lights[%d].cosatt.xyz, float3(1,attn,attn*attn))) / dot("I_PLIGHTS".lights[%d].distatt.xyz, float3(1,attn,attn*attn));\n", index, index);
|
||||
}
|
||||
|
||||
|
@ -571,7 +571,7 @@ char *GenerateLightShader(char *p, int index, const LitChannel& chan, const char
|
||||
else if (chan.attnfunc == 1)
|
||||
{ // specular
|
||||
WRITE(p, "ldir = normalize("I_LIGHTS".lights[%d].pos.xyz);\n",index);
|
||||
WRITE(p, "attn = (dot(_norm0,ldir) > 0.0f) ? max(0.0f, dot(_norm0, "I_LIGHTS".lights[%d].dir.xyz)) : 0.0f;\n", index);
|
||||
WRITE(p, "attn = (dot(_norm0,ldir) >= 0.0f) ? max(0.0f, dot(_norm0, "I_LIGHTS".lights[%d].dir.xyz)) : 0.0f;\n", index);
|
||||
WRITE(p, "attn = max(0.0f, dot("I_LIGHTS".lights[%d].cosatt.xyz, float3(1,attn,attn*attn))) / dot("I_LIGHTS".lights[%d].distatt.xyz, float3(1,attn,attn*attn));\n", index, index);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user