Sign in to follow this  
madox

Trouble with reflections

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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this