Vehicle Shadows: Collision mesh only?
by Henry Todd · in Torque Game Engine · 08/23/2007 (6:16 pm) · 4 replies
I have a couple of questions about 1.5.x's shadow generation for dynamic objects, specifically Vehicles. Hopefully someone with more experience with the TLK code can help me out here.
This seems to be a new thing for 1.5 to me, but I could be completely incorrect. Anyway, Vehicle object shadows are always rendered as a shadow of the Collision mesh, which is generally a very poor approximation of the shadow. Is there any easy way to control which LoD mesh is used to generate the shadow? If not, I suppose I'll be spending a bit of time taking the shadow code apart to figure out where it makes this choice.
On a related note, is there any control for the distance the shadow is cast? It seems to currently be scaled based on the size of the object's bounding box, which is fine for Players and small vehicles, but creates massive slowdown when a large vehicle casts a shadow on a complex Interior, due to the fact that interiors can block shadows.. these calculations become complex very quickly when stacked on top of each other.
This seems to be a new thing for 1.5 to me, but I could be completely incorrect. Anyway, Vehicle object shadows are always rendered as a shadow of the Collision mesh, which is generally a very poor approximation of the shadow. Is there any easy way to control which LoD mesh is used to generate the shadow? If not, I suppose I'll be spending a bit of time taking the shadow code apart to figure out where it makes this choice.
On a related note, is there any control for the distance the shadow is cast? It seems to currently be scaled based on the size of the object's bounding box, which is fine for Players and small vehicles, but creates massive slowdown when a large vehicle casts a shadow on a complex Interior, due to the fact that interiors can block shadows.. these calculations become complex very quickly when stacked on top of each other.
About the author
Recent Threads
#2
08/23/2007 (8:58 pm)
I had the same problem, shadows from my vehicles were being cast from the bounding box and not the mesh. It turned out to be an error in my setup of the Max scene, it was a few years ago though so I can't remember the exact details.
#3
www.garagegames.com/mg/forums/result.thread.php?qt=48781).
I use Milkshape and haven't had that particular problem, but someone who is familiar with the correct setup will hopefully chime in here. Somewhere in the Docs is a proper setup for Max, again not sure where it is but if you trudge through them you should come across the hierarchy chart and maybe someone who has had the same issue will remember what the exact problem is.
08/23/2007 (9:52 pm)
Ross is right, and Tim is correct that it probably has to do with your model setup. I don't use Max so I can't help you on that end, but I do know that vehicles cast their shadows from the mesh - (note about half-way down this thread: www.garagegames.com/mg/forums/result.thread.php?qt=48781).
I use Milkshape and haven't had that particular problem, but someone who is familiar with the correct setup will hopefully chime in here. Somewhere in the Docs is a proper setup for Max, again not sure where it is but if you trudge through them you should come across the hierarchy chart and maybe someone who has had the same issue will remember what the exact problem is.
#4
The only variables here are 1.5.2 (but some of my older models, not to mention the stock "buggy" model, don't have this issue, so it's unlikely to actually be a TGE version problem), Max 7, and the new version of the exporter. The scene setup is identical to how I've always done it, as well as the various old examples from the TGE documentation. The fact that every other aspect of the DTS works 100% also suggests to me that it's unlikely to be a scene configuration error; the collision mesh is being used for collision and is not being rendered; all of the LoDs of the vehicle work perfectly; mount, camera, and eye points work fine. I've even tried using the plugin to auto-configure the hierarchy. Everything still works, but I also still have shadows cast from the collision mesh.
When I get some time later today, I'll load up an old max file I haven't edited since I exported it to DTS a year ago. If re-exporting it results in the same shadow problem, I'll know that it's either Max 7 or the version of the exporter I'm using.
08/24/2007 (8:51 am)
As far as setup, I'm 100% familiar with how you configure and export a DTS object from Max; I've been doing it since TGE 1.2 with no issues, hence why my perspective was that this is a problem with a new version. Apparently that's not the issue either..The only variables here are 1.5.2 (but some of my older models, not to mention the stock "buggy" model, don't have this issue, so it's unlikely to actually be a TGE version problem), Max 7, and the new version of the exporter. The scene setup is identical to how I've always done it, as well as the various old examples from the TGE documentation. The fact that every other aspect of the DTS works 100% also suggests to me that it's unlikely to be a scene configuration error; the collision mesh is being used for collision and is not being rendered; all of the LoDs of the vehicle work perfectly; mount, camera, and eye points work fine. I've even tried using the plugin to auto-configure the hierarchy. Everything still works, but I also still have shadows cast from the collision mesh.
When I get some time later today, I'll load up an old max file I haven't edited since I exported it to DTS a year ago. If re-exporting it results in the same shadow problem, I'll know that it's either Max 7 or the version of the exporter I'm using.
Torque Owner Ross Kabus