Game Development Community

Self Shadow

by Israel Lazo · in Torque Game Engine · 03/27/2006 (4:40 am) · 11 replies

How can I make a DTS Object to cast shadow on another DTS object, for example, I want a DTS object to cast a shadow to a DTS Floor that I made.
Is it Posible? I asked before on the General Discussion before buying the product and they said YES.. but I do I make it.. I don't care if it's static but I need to cast shadows on them..

THank you

#1
03/27/2006 (5:20 am)
You have to define it in head code somewhere, I did it once but can't remember where. It's only a minor change, I'll look it up & let you know
#2
03/27/2006 (5:34 am)
I don't know if this is the best way to do it but it works.

Go into engine/game/shadow.cc at around line 26 find this

U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType;

and change to
U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType | StaticShapeObjectType;
#3
03/27/2006 (8:31 am)
OH MY GOD THANK YOU!

I will try it today ans wee hoy it worked, thank you!
#4
04/01/2006 (3:16 pm)
Just a warning: that change will make the shadows get cast on the statics's collision meshes, not on their actual geometry, so shadows might look strange on shapes where the collision meshes are too different from the actual geometry.

A nicer option would be a flag on statics to toggle shadow recieving per object.
#5
04/06/2006 (6:38 pm)
Manoel how do you do that, flag on statics to toggle shadow recieving per object.. ??
I found out that DTS objects do not cas shadows on it self... it actually didn't do much changes on the screen, and it did compile succesfully. . .

I just need neat shadows that's all.. OH! and how do you fix the error on the shadows when you look on sertain angles, because they just disapear when I look at it in some angles..

Well that's it with my questions.
#6
07/18/2006 (9:24 am)
Thats to do with the shadows not being a sceneobject, take a look at this:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9643
#7
10/30/2006 (8:57 am)
Works this also for TGE 1.5 ?
#8
10/31/2006 (1:22 am)
Yup, 1.5 uses the same shadow code - but this way of casting shadows casts onto the collision meshes, so make sure the receiving objects have them.
#9
11/02/2006 (2:45 pm)
I tried to do so but I didn't work. My both meshes have collision meshes. :(
#10
05/11/2009 (9:56 pm)
Thanks!!! Really work for me, on macintosh and windows with torque 1.5
#11
05/11/2009 (10:17 pm)
There was an old resource for stencil shadows for about 1.3, I'd like to see whether that can be stuck in 1.5. That would enable self-shadowing and stuff.
Or just get TGEA ;P.