Jump to content
  • Advertisement
Sign in to follow this  
madox

Trouble with reflections

This topic is 4131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hopefully someone can give me some tips on reflections. My current project has a number of game peices sitting on a board, and I want the board to be reflective. I have done this by rendering copies of the game pieces upside down, and blending them with the board. The pixel shader sets the reflected object's alpha to 0.5 An idea of what the board looks like is here: Game Board The problem is that the game peices end up looking fully transparant in the reflection when they shouldn't be (you can see some legs though the reflected body). I highlighted the problem here: Reflection Problem I'm guessing that the legs are being rendered first, then the body, so blending kicks in and blends them. If the body was rendered first, the legs wouldn't show up at all there. However, I don't know how to easily make a mesh render its subsets front to back. I can imagine sorting prims manaully is possible but tedious. Will this sorting fix this problem and/or how do you guys do reflections?

Share this post


Link to post
Share on other sites
Advertisement
can you render the mesh normally, which would make the back legs not visible, and then render the game board with some transparency?

that might work

Share this post


Link to post
Share on other sites
True - that is an option in this case, but more generally, any mesh I want to render transparently would have this problem. If I had one transparent mesh visible through another transparent mesh, the rendering order wouldn't fix it. There must be some other way to fix this.

Share this post


Link to post
Share on other sites
I think you should use projective texturing for rendering reflective plane.
In this case there will be no problems.

Share this post


Link to post
Share on other sites
Quote:
Original post by madox
....by rendering copies of the game pieces upside down, and blending them with the board. The pixel shader sets the reflected object's alpha to 0.5


You should draw the reflected objects normally (with no transparency), then blend the board on top of them. Then draw the non-reflected objects. That is the usual way.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!