Game Development Community

Blending: Interiors vs. 3space objects

by Fenrir Wolf · in Torque Game Engine · 09/24/2003 (6:09 pm) · 3 replies

Alright, I've been living inside of Interior.cc and InteriorRender.cc for the last few days and I've got some questions. Well, OK, just one question. I'm hoping those who have done more general work with Torque's rendering engine can help me out by pointing me in the right direction.

.dif files (aka interiors) seem to have their own rendering subset, as defined in InteriorRender.cc. Therefore, they do their thing in an entirely different manner than 3space objects. So, I wonder:

How does Torque handle sequencing of alpha-blending polygons? I mean, things like fxReplicator render properly, and so do .dts objects. According to the doxygen docs, SceneGraph is the base of all of these objects (Static, Player, etc.) that handles things like sorting alpha-blended polys.

I've modified my InteriorRender.cc so it will properly render polygons with transparency. It's even aware of surfaces that contain alpha polys and will not cull them. But I want to modify the code so it properly depth-sorts the alpha polys, and that means somehow injecting them into the render stream where all other possible rendering functions that might draw alpha-blended polys.

If someone could point me in the right direct on this, I am sure I can knock it out. I've already modified interior.cc so it breaks out alpha surfaces into a seperate render chain. But drawing those back-to-front will zorch any alpha polygons that TSStatic or whatever might have already rendered... I want to release this as a resource (plus my interior environment mapping mod) once I'm done.

#1
09/24/2003 (6:39 pm)
You'll need to muck with the RenderImage stuff, I fear, to get this to work out right. You might need to emit several and render the interior in chunks per RenderImage.
#2
09/25/2003 (1:36 pm)
*pokes around* Oh, I think I see how it works. You create a RenderImage and then insert it into the render chain. Yeah, this could get ugly. Thanks, Ben, this points me in the right direction. Won't say I will have a solution soon, but at least I know where to go from here. :)
#3
09/28/2003 (4:23 am)
I've added trans and it works.. when TGE 1.2 comes out.. maybe I'll post the code on how to add it :)