Shadows
by Chris Sargent · in Torque Game Engine · 09/14/2008 (6:02 pm) · 8 replies
When I was playing around today in the starter.fps I selected barebones mission and then from there I created a new mission.
I changed my terrain by using the teraform editor and selected the terrain file so i got a flat terrain. After that, I textured the terrain for snow and added a cottage. I relit the scene (of course after putting in my light emiter so my interior wasn't pitch black :P ), Next, I added two trees on either side of the cottage and relit the scene again.
The trees do not cast shadows at all. How do I resolve this? or do the stock trees in the starter.fps just don't have shadows?
Thanks again!
I changed my terrain by using the teraform editor and selected the terrain file so i got a flat terrain. After that, I textured the terrain for snow and added a cottage. I relit the scene (of course after putting in my light emiter so my interior wasn't pitch black :P ), Next, I added two trees on either side of the cottage and relit the scene again.
The trees do not cast shadows at all. How do I resolve this? or do the stock trees in the starter.fps just don't have shadows?
Thanks again!
About the author
#2
09/15/2008 (6:05 am)
Ah thanks Daniel. I'll have to look harder and try to see them. I just looks funny with a cottage casting a shadow and then two trees right outside the door and nothing.
#3
09/15/2008 (6:16 am)
Did you re-light the mission?
#4
09/15/2008 (6:35 am)
Yes i did the mission relight many times and the trees never cast any visible shadow that i can see
#5
09/15/2008 (7:30 am)
I cant quite recall the stock trees, but try this, open them in Show Tool, make sure you enable visible collision mesh. You should see a translucent blue mesh around the trunk if a collision mesh is present. Without this mesh, no shadows will be cast. Also open up the lighting menu in the editor, play around with the settings. Also more settings in the properties pane of the dts. Hope this helps.
#6
09/15/2008 (7:56 am)
Isn't it possible to get static shapes to cast real shadows (i.e., not the terrain shadows that DIFs use)?
#7
I made a hack for this: www.garagegames.com/mg/forums/result.thread.php?qt=74983
@daniel
it is possible, i've done this for staticshapes, it's some time ago and the only part i remeber was to set the detail to "0" in sgObjectShadows::sgRender (about line 300):
Maybe i did change some other things, too.
Edit: Sorry, I am a bit confused today the last hack was to cast a "real" shadow for staticshapes not to make all objects cast an shadow. But if you like to change TSStatic to cast an shadow add some code like in StaticShape::renderShadow(F32 dist, F32 fogAmount) to tsstatic and remove mTypeMask |= ShadowCasterObjectType; from tsstatic.
09/15/2008 (11:09 am)
For some strange reason the shadowCasterObjectType objects dont make an shadow, because the raycast fails on some angles- don't ask me why ;)I made a hack for this: www.garagegames.com/mg/forums/result.thread.php?qt=74983
@daniel
it is possible, i've done this for staticshapes, it's some time ago and the only part i remeber was to set the detail to "0" in sgObjectShadows::sgRender (about line 300):
//XXTH detail min 0 added ! THIS MAKE RENDER SHADOWS NOT ON THE COLLISION MESH !! shadow->selectShapeDetail(shapeinstance, dist, maxscale,0); //orig: shadow->selectShapeDetail(shapeinstance, dist, maxscale);
Maybe i did change some other things, too.
Edit: Sorry, I am a bit confused today the last hack was to cast a "real" shadow for staticshapes not to make all objects cast an shadow. But if you like to change TSStatic to cast an shadow add some code like in StaticShape::renderShadow(F32 dist, F32 fogAmount) to tsstatic and remove mTypeMask |= ShadowCasterObjectType; from tsstatic.
#8
Yes it is. I have an example in my blog post of 2 DTS shape buildings casting real time shadows -
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=15403
I had to make some changes to the engine if I remember correctly. If this is what you want let me know and I'll dig up what I did.
09/16/2008 (8:29 am)
Quote:
Isn't it possible to get static shapes to cast real shadows
Yes it is. I have an example in my blog post of 2 DTS shape buildings casting real time shadows -
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=15403
I had to make some changes to the engine if I remember correctly. If this is what you want let me know and I'll dig up what I did.
Torque 3D Owner Daniel Hopkins
Default Studio Name