Game Development Community

Make DTS transparent?

by Caleb Child · in Technical Issues · 11/24/2006 (6:24 pm) · 6 replies

Hey, does anyone know how I could run a transparency or invisibility effect on a DTS object upon command?

I've got an advanced camera set up, and the game will be running through the orbit mode. I'm just looking ahead, and it seems to me that I'm likely to run into a situation where I have various geometry obstucting the view of the player. I'd like to be able to re-write some of the engine so that when any DTS obstucts the view of the player it turns invisible or perhaps just transparent.
I've seen many effects like this before in proffesional games, and there are lots of ways I've seen people maintain visibility of the player when obstructed. I'm not particularly fond of the ones where an object just instantly turns to a transparency, I much prefer ones that have gradiant effects where only part of an object is made transparent, and also effects where the player is somehow extra-visible beyond everything else around him.
Also, I imagine it would be helpful if I could have all dts objects have a flag that determines whether or not it would turn invisible if it is obstucting the view, as some objects would have no need to do so.

However, realistically speaking, I don't know what can be done inside of Torque, especially with my limited abilities. So I guess before deciding to what extent I want things to be invisible or whatever else miscelaneous effects could happen, I need to first know what I CAN do, and how to go about doing it.

Does anyone have some ideas, suggestions, or best of all some refferances on how to do this? I don't really know anything about making changes this advanced, so I'll take any help I can get.

Thanks.

#1
11/24/2006 (6:50 pm)
Search your projects codebase for 'setAlphaAlways' to see how Torque alpha fade. Also in TSStatic::renderObject if you look it over carefully you should see how to do what you need, and this would be the easy place to do it.
#2
11/29/2006 (12:47 pm)
Look up cloaking. Theres a function in the engine that already does this.

%yourobject.setCloaked(true);

done.


You can also specify the cloak texture in your objects datablock with 'cloakTexture = "....";
#3
11/29/2006 (12:59 pm)
Check this link out.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8621
#4
11/29/2006 (2:17 pm)
%yourobject.setCloaked(true);
#5
11/29/2006 (2:22 pm)
Buy The Game Programmer Guide To Torque and read it... most answers are in it and save your time.

STef
#6
11/30/2006 (1:22 pm)
Okay, so there's already a function called "setCloaked."
Excellant, that means that there's something I can use right away. Even if it winds up being one of the less-desirable invisibility effects, at least it will work for the time being. When I actually know what I'm doing, I'll be able to take Caylo's advice and create a more proffesional-looking effect.

Thank you!