Shadows on statics...
by Brett Fattori · in Torque Game Engine · 04/06/2003 (9:16 pm) · 8 replies
Here's a nice little piece of code to get shadows cast on static objects. It can look a little flakey at times, but it works.
In shadow.cc change:
Voila! Shadows on static objects... :-)
EDIT: It appears that this only works if the object has a collision object attached.
- Brett
In shadow.cc change:
U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType;to read:
U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType | StaticRenderedObjectType;
Voila! Shadows on static objects... :-)
EDIT: It appears that this only works if the object has a collision object attached.
- Brett
#2
04/07/2003 (12:46 am)
Quote:get shadows cast on static objectsI dont think it makes the objects cast shadows, just lets shadwos fall on them.
#3
But to get it the other way around would rock, too ;)
04/07/2003 (1:14 am)
Ah, yeah, that would make sense... :)But to get it the other way around would rock, too ;)
#4
- Brett
04/07/2003 (7:15 am)
I'm plugging through shadow code right now.. I'd like to get shadows on my models too. I'll see what I can find Beffy.- Brett
#5

The two Cessnas are statics... :-)

Another angle (which is where I'm having problems). At some angles the static shadows disappear entirely. They are being rendered, but to where?? I don't know yet.
- Brett
04/07/2003 (9:14 am)
Okay, update time... I have shadows working for statics (somewhat) but it requires that you don't enable shadow "catching" on statics. So, you have to change the line above back to:U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType;Otherwise statics tend to shadow themselves (and not in a self shadowing way as I'd expect.) Buuuttt... here's a teaser (until I get this all working right)

The two Cessnas are statics... :-)

Another angle (which is where I'm having problems). At some angles the static shadows disappear entirely. They are being rendered, but to where?? I don't know yet.
- Brett
#6
05/06/2003 (6:53 pm)
ignore this
#7
05/06/2003 (7:02 pm)
ignore me too
#8
05/06/2003 (11:36 pm)
sorry, having trouble with posts, wont let me delete them... ugh.
Associate Stefan Beffy Moises
didn't do anything for me I think...
and I had to make some other changes to get DTS objects cast shadows, but I wasn't able to get them to render correctly (see this post...)