Game Development Community

Real-Time dif Transparency

by Brandon Pollet · in Torque Game Engine · 01/26/2005 (10:49 pm) · 3 replies

I have been looking for info about this for a few hours and have decided to just post the question.
How can I change the opacity of sections of interiors depending on in-game actions. in real-time?

For example:
If I have a top-down camera following my player and he sees a house up ahead, I want to be able to see the house, roof and all. However, if I move the player into the house I want the roof and upper floors to become transparent so that I can see what is on the ground floor.

Let me know where I should look in the engine code to set something like that up, it looks like you could do it with portals if you changed how the world was rendered but I would like to find an easier solution.

Thanks

About the author

Brandon earned a Master's of Science in Computer Science from the University of Tulsa in 2005 before they asked him to leave. Since then he has worked in web development and mobile development all while honing his game design/programming skills.


#1
01/31/2005 (1:35 am)
Perhaps you could Have the roof and upper floors seprate objects... and then when you go inside you simply... remove them?

Ken
#2
01/31/2005 (1:50 am)
If i understand you correctly you won't gain anything using DIF Objects (maps) since the whole BSP/Portal concept won't work for you. I would recommend to use DTS instead of DIF. This will give you alot more Options and it is relatively easy to modify the source code for the TSStatic.

Have a look at:

SceneObject (check out the fxRenderObject resource, search for it here on GG)
TSStatic classes

Personally, i would modify the StaticShape to include a toggle to render it solid or Blended (see glBlendfunc etc.) that you can use in scripting. Put triggers at the doors and change render to GL_BLEND.

Let me know if you need some more help, i don't know how familiar you are with OpenGL and the source.

Sascha

PS: Obviously this would affect performance for really BIG structures. But if you only have houses etc like in an RPG it wont make much difference.
#3
01/31/2005 (9:13 am)
That sounds good. Thanks for pointing me in the right direction. I'm learning OpenGL right now so I'll dive in and see what I can do.
Thanks