Skip to main content
gamedev.net
🔒 Locked

transparencies

Started by black_mage_s Jun 11, 2002 at 11:53 AM 1 replies 350+ views
Original Post
black_mage_s
black_mage_s
i never noticed this problem before, but it came to be a problem for one part of my game. For this one area, there are windows all around a room. They can be seen through, but at a certain distance, they start to reflect things near them, like this: || ||-- 50% reflection -- 25% reflection -- 0% relection ||-- ^ Window Now, the problem is, since i dont want the character to have a solid relection like in a mirror, i have to use a transparency effect. And the problem there is, with this effect, if the character was to put his hand behind his back, you can see the hand in the window, through the characters back. How do i fix this?
"Luck is for people without skill."- Robert (I Want My Island)"Real men eat food that felt pain before it died."- Me
xs_mak
xs_mak
I think of using ''render to texture''. You may render what the mirror sees ones as a texture. Then use the texture as the mirror in the scene. I think there may be better ideas.
TheMuuj
TheMuuj
quote:
Original post by xs_mak
I think of using ''render to texture''. You may render what the mirror sees ones as a texture. Then use the texture as the mirror in the scene. I think there may be better ideas.



It can be done with pixel shaders, and it can be done by rendering the model to a texture and rendering a quad on the window.

I have seen many games with ''ghost'' models that use translucent skins, and programmers usually do not even attempt to tackle this problem. Take Morgan Katarn''s model in Jedi Outcast, for example.

You might try transforming the reflected model''s vertices into their final position, and then sorting the faces by their distance from the camera. Sort from nearest to farthest. Then render the triangles in order, and triangles in the back will not be rendered due to Z-buffer testing.

This is just the opposite of what you wanted to do if you were in fact rendering real translucent objects, and not a reflection.

Does anyone see why this wouldn''t work?

If you get the effect working, I would love to see it. I don''t think I have ever seen anyone attempt a reflection in a window.

--TheMuuj
--TheMuuj

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.