Create valid vertex shader when using emboss mapping and binormals and tangents are missing. Fixes issue 2867.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6944 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
donkopunchstania 2011-01-28 04:13:46 +00:00
parent cb91be81ed
commit fec3daf713
1 changed files with 5 additions and 1 deletions

View File

@ -410,7 +410,11 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
WRITE(p, "ldir = normalize("I_LIGHTS".lights[%d].pos.xyz - pos.xyz);\n", texinfo.embosslightshift); WRITE(p, "ldir = normalize("I_LIGHTS".lights[%d].pos.xyz - pos.xyz);\n", texinfo.embosslightshift);
WRITE(p, "o.tex%d.xyz = o.tex%d.xyz + float3(dot(ldir, _norm1), dot(ldir, _norm2), 0.0f);\n", i, texinfo.embosssourceshift); WRITE(p, "o.tex%d.xyz = o.tex%d.xyz + float3(dot(ldir, _norm1), dot(ldir, _norm2), 0.0f);\n", i, texinfo.embosssourceshift);
} }
else _assert_(0); // should have normals else
{
_assert_(0); // should have normals
WRITE(p, "o.tex%d.xyz = o.tex%d.xyz;\n", i, texinfo.embosssourceshift);
}
break; break;
case XF_TEXGEN_COLOR_STRGBC0: case XF_TEXGEN_COLOR_STRGBC0: