1
0

CSoftwareDriver2: Normalmap like Irrlicht. Lightpos in vertex space

CSoftwareTexture2: Tweaking (guessing linear Image)
CBlit.h: allow mirror image (SuperTuxKart)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6105 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
engineer_apple
2020-03-01 22:33:55 +00:00
parent f74abf1d2b
commit bca8023261
3 changed files with 39 additions and 13 deletions

View File

@@ -1857,12 +1857,17 @@ void CBurningVideoDriver::VertexCache_fill(const u32 sourceIndex, const u32 dest
if ( !light.LightIsOn )
continue;
// lightcolor with standard model
// but shader is different. treating light and vertex in same space
#if 1
vp.x = light.pos.x - base->Pos.X;
vp.y = light.pos.y - base->Pos.Y;
vp.z = light.pos.z - base->Pos.Z;
#else
vp.x = light.pos4.x - EyeSpace.vertex.x;
vp.y = light.pos4.y - EyeSpace.vertex.y;
vp.z = light.pos4.z - EyeSpace.vertex.z;
// lightcolor with standard model
// but shader is brighter and using different normalmatrix
#endif
// transform by tangent matrix
light_accu.x += (vp.x * tangent->Tangent.X + vp.y * tangent->Tangent.Y + vp.z * tangent->Tangent.Z );