Game Development Community

Dts disappearing

by Faraz Ahmed · in Torque Game Engine · 07/05/2006 (11:21 pm) · 7 replies

Hi,

www.lotustechnic.com/temp/ssissue.jpg
Im trying to place a crowd inside a stadium in a scene. The crowd has been created using multiple planes inside max with a transparent people texture on each plane. These are simple plane primitives inside of max and the material properties have been checked as one-sided. These planes were exported as a dts within a bounding box that encloses the entire set of planes. The problem is that once I place the crowd inside the scene and fly a camera towards it, the crowd randomly disappears (gets culled? is that the technical term).. moving the camera fast towards the set of crowd planes results in a flickering effect. I'm sure this is something silly that I'm missing but I just can't seem to figure out why this happening. Any help appreciated.

Thanks

#1
07/05/2006 (11:58 pm)
Set your detail to 1, make sure your bounds are encompassing the entire mesh
#2
07/06/2006 (12:03 am)
Hi Jenny,
How large is the final crowd object?

If it's a very large DTS, it will be culled when the camera passes the center of its bounding box.

If that's what's happening...

1. You can break the single DTS into smaller objects. (This is the approach I wound up taking.)
2. If the object is a descendant of SceneObject, you can use the setGlobalBounds member to give it an "infinitely large bounding box". (I've had no success with this so far.)

Ben Garney's post about setGlobalBounds
My initial venture into the realm of large DTS objects
My subsequent attempt to figure out setGlobalBounds

Hope that's helpful!

-- JohnDopp
#3
07/06/2006 (12:50 am)
In case it's useful, here's the solution I ultimately used.

The object in question was a large space station, roughly 4800 x 4800 x 8400 Torque/3DS Max units....
www.distantfate.net/screenshots/station2.jpg
From this master template, I saved copies for each component, deleting the other parts of the ship. I created a bounds object with its pivot at 0,0,0 for each component.
www.distantfate.net/screenshots/station3.jpg
From there, I just exported each to a separate DTS, imported them into Torque, and set the location of each component to 0 0 0. Piece of cake.

www.distantfate.net/screenshots/station1.jpgThe station's components reassembled in Torque.

Because my object was radially symmetrical, I could re-use components like sections of the deck and the central spindle, which cut down on file sizes dramatically. I just copied the components and rotated each around the origin (using the type-in transform, NOT the handles -- the handles rotate the object around its center, whereas the type-in transform rotates around the origin of the bounding box).

I'd imagine you could use a similar approach for your crowds, rotating them around the center point of your stadium.

Luck!

-- JohnDopp
#4
07/06/2006 (3:49 am)
@john, hi... thanks a lot for the guidance. Thats a great way of breaking down the crowd and maintaining relative positioning without much headache. I'll give it a go and let you know how it goes. By the way... nice sky box with that station!

@andrew, i'm not sure what you mean by setting the detail to '1'. Does that refer to the detail node in max being called detail1 or is there something I am missing.

The problem is still weird though because the stand on which the crowd is sitting is a way larger and has no problems. Also another thing, we were having transparency issues so I used SORT:: before the crowds mesh name to fix that problem. So there is some difference between how torque is rendering the crowd vs the stand. For now I'll give John's technique a go.. going to avoid digging into complex rendering code right now!

Jen
#5
07/06/2006 (8:01 am)
For what it's worth, with the crowd being pretty much a static object, you are probably better served by having them be a DIF than a DTS in terms of the rendering pipeline.
#6
07/06/2006 (1:21 pm)
@Jenny: It's worked quite well so far, although I did have to increase the visible distance to get the whole shebang in the picture.

As for the skybox, thanks! I think I've got space skyboxes down to a science now, and will write up a Photoshop / 3DSMax / Torque tutorial for creating them when time permits. They're surprisingly easy to do once you learn the routine.

Cliff's got an interesting point about the DIFs, although you'd have to use the InteriorRender Transparency fix to implement it. It's pretty easy to integrate into the source code, but if you're code-shy, the DTS approach works just fine.
#7
07/06/2006 (9:51 pm)
So apparently the problem is with using the SORT:: operator before a mesh name in the exporter. The polys within the mesh appear just fine but when you place the mesh on top of another object in the scene, the engine gets confused and "randomly" culls out one object. For now we're just going to integrate the crowd with the stadium and export it together. IFL textures can be embedded onto shapes with static textures and they animate fine. DIF's are probably not an option since they cannot be animated (or have animated textures)... (I think!!). Plus my disgruntled modeler will run away if I ask him to use that Quark editor thing for anything :p