Game Development Community

T3D 1.1 Beta 3 - Incorrect shadow transform (+fix) - LOGGED

by Ivan Mandzhukov · in Torque 3D Professional · 11/30/2010 (4:39 pm) · 20 replies

Hi,
in BL the shadow is just a decal.
Currently if you try to rotate an object on the fly (c++) you will see wrong shadow results.
The problem is: lightning and shadow transforms usually work with non-rotated render-transforms.

In projectedShadow.cpp , locate :
// Set up the decal position.
// We use the object space box center
// multiplied by the render transform
// of the object to ensure we benefit
// from interpolation.
renderTransform.mulP( boxCenter );

And replace with:
// Set up the decal position.
// We use the object space box center
// multiplied by the render transform
// of the object to ensure we benefit
// from interpolation.
MatrixF T = mParentObject->getRenderTransform();
Point3F up(0,0,1);
T.setColumn(2,up);
T.mulP( boxCenter );

#1
11/30/2010 (5:01 pm)
Thank you!
#2
12/01/2010 (6:47 am)
thanks.
#3
12/03/2010 (5:00 pm)
Nice. Thanks Ivan.
#4
12/16/2010 (12:31 am)
I haven't tested this yet... can anyone else confirm its a good fix?
#6
12/16/2010 (7:47 am)
Hi Tom/Sickhead.

I'm pleased to see you on the forums.

Does this mean you are still at works actually on T3D?

If the answer is 'Yes', is it for public release or internal work?

I hope your future is still bright.

Nicolas Buquet
www.buquet-net.com/cv/
#7
12/16/2010 (1:45 pm)
Ehy Tom, seeing you around is really comforting :-)
#8
12/16/2010 (4:20 pm)
I agree!

Crossing my fingers and wishfuly waiting...

best regards
kaj
#9
12/17/2010 (4:15 am)
We're still under contract and are attending to some fixes for T3D... I can't really share more than that right now.
#10
12/17/2010 (7:40 am)
Thanks for the answer Tom : T3D continues in undercover mode. :-)
#11
12/18/2010 (12:22 am)
Tnx Tom for that, even if those infos are not so much, those infos make us so much happy :-)
#12
12/18/2010 (7:37 pm)
Nice work Ivan :)

Tom! Good to see you're still here and with some good news about some continued work on T3D.
#13
12/21/2010 (10:30 am)
Tom, you are a rock star
#14
01/07/2011 (10:58 pm)
Logged as THREED-1300.
#15
01/28/2011 (2:18 pm)
@Ivan - Can you drop me some code which can reproduce this bug?
#16
01/28/2011 (2:34 pm)
Here is an example how to reproduce this bug:

http://www.garagegames.com/community/resources/view/3148

This is the old resource "Conform Player to Terrain",that actually rotates the player on sloped surfaces.
Put the player on a horizotal surface - the shadow is correct.
Create a sloped surface (round about 30 degrees),you'll see the player's shadow a metre away from the player.
#17
01/30/2011 (3:31 am)
Fixed for 1.1 final. Thanks Ivan.
#18
01/30/2011 (3:31 am)
Double post... damn you CloudFlare!
#19
01/31/2011 (7:04 am)
Hmm, wondering - does the 'conform to terrain' work on dts shapes? I'm thinking an Escher-esque FPS now - imagine a firefight in a tesseract....
#20
01/31/2011 (1:31 pm)
I had noticed "...sloped surface (round about 30 degrees),you'll see the player's shadow a metre away from the player..." is true for Advanced Lighting, I notice it because I have terrain generating self shadows turned off.