Game Development Community

Shadow on water

by Harvey Greensall · in Torque Game Engine · 05/21/2006 (5:39 pm) · 5 replies

Hi all.....

Can anybody think of a way of getting vehicle shadow to cast on the waterblock surface using TLK...Even if it's instead of it casting on the terrain....We've a water based title, and it would help considerably...

Thanks in advance as always...

#1
05/23/2006 (1:37 am)
Hi Harvey,

Hmmm, interesting question. I'm not sure this will work correctly, but you could try adding the water block to the shadow's list of 'receiving' objects.

In 'game/shadow.cc' add the following:

U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType [b]| WaterObjectType[/b];


This might not work - I'm not sure that the water block registers the normal collision system methods, but it's worth a shot.
#2
05/28/2006 (4:34 am)
I tried that a while ago, didn't work for me
#3
05/30/2006 (5:38 am)
Hmmm, I was afraid that wouldn't work. However I have another idea. :) What you really need for shadows of this nature is some sort of projection, either texture or stencil. I would check out the stencil shadow resource for TGE - it may already darken the water, if not it should be easy to modify the code to do it.
#4
06/10/2006 (9:20 pm)
My player cast reflection in the water pretty well. Ive tested the vehicles and nodice. Im shure It would be possible though because the character Orc is a dts and it cast reflection well. Its just a matter of putting whatever objecttype you named your water vehicles in that particular renderpass (whereever that pass is).

Oh and Im aware that your talking about shadow but if your making a water game then you may want to get this water look;) I loved games like Waveracer lol.

http://img83.imageshack.us/img83/8936/terrain7ml.jpg
#5
06/25/2006 (1:40 am)
Adding it to the collision mesh in objecttypes wont work either