Alpha on alpha

JasonH

23-02-2009 21:47:23

Trying to create an element that is only visible when viewed through another element, like an object only being visible through a particular window, but not any other time. New to this forum, and relatively new to ofusion and ogre, so really pretty helpless unfortunately. I'll keep working at finding a solution, but i'm afraid i'm mostly guessing at the moment.

Lioric

24-02-2009 15:36:33

Is the window the only transparent part (and the other parts are solid)? or do you need that the object be visible only in some of the tranparent parts and not in others?

For creating transparency in the window, see the "A simple glass effet using alpha environment mapping" sample in the scenes section

If you need the object to be visible only in some of the windows but not in others, you will need to create a clipping system in your application where you clip the bounding box of the object with the bounding box of the window and only set the show or hide state of the object based on if it is inside the window clip region

JasonH

24-02-2009 19:23:44

Hey, thanks for the help. I'll give those things a try. Ultimately, I'm trying to find a way to create an effect, where item A is invisible until viewed through the lens of item B, like the blood clues in Condemned. I'll give these tips a try. thanks again

Lioric

26-02-2009 16:39:32

If you want an even easier solution for your needs, then you might want to use a render to texture in the lens, that way it will only render the objects that you select it in the RTT and not the others, or some objects can be rendered differently when viewed with the lens using material schemes (rendered with a different material when in the lens and with the default material the other time, if the object is half in the lens and half outside it it will be correctly rendered half with the "lens only" material and half with the normal material)