Sign in to follow this  

Alpha blending complex objects from arbitrary position

This topic is 3727 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

Hi everyone, How would I render a transparent object that blends with itself from any position? For example, a car or a bottle where the camera can look at the object from any point in the scene? I understand that in general, alpha blended objects must be rendered in back-to-front order. Also, I understand that you can render the back faces of an object first, and then the front faces so you get the right transparency. But how could you do it with an object like a bottle that you can view from any position? I could sort the mesh triangles by depth but this gets expensive quickly in scenes with more than just a few complex objects. Are there any other techniques that could be used? Or some sort of pre-processing step that would let you quickly render in back-to-front order at runtime? neneboricua

Share this post


Link to post
Share on other sites
Depth peeling is the general solution, but it is rather expensive. Alpha-to-coverage may work for you but realize that it's just screen-door transparency on the sub-pixel level (when MSAA in enabled), so can produce some ugly artifacts if there is insufficient resolution (arguably no worse than not sorting at all though).

Share this post


Link to post
Share on other sites
I don't know of any silver bullets for this, but a few ideas:

* depth peeling, e.g. http://research.microsoft.com/research/pubs/view.aspx?tr_id=1125

* break the mesh up into concave parts and just sort those as well as using the "render back faces then front faces" method.

* if you have the available memory, store multiple index buffers pre-sorted from a few major directions (better when your camera has known constraints). The order isn't 'perfect' from every angle, but usually it's adequate.

* only sort high LODs properly. Use something like the pre-sorted IBs for lower LODs.

Share this post


Link to post
Share on other sites
Thanks for the tips guys. I had forgotten about the depth peeling stuff. Splitting the mesh into concave sections is also a good idea and could be a nice little shortcut in many cases so you don't have to sort as much stuff.

neneboricua

Share this post


Link to post
Share on other sites

This topic is 3727 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.

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