Vegeta Posted June 23, 2013 Posted June 23, 2013 (edited) I'm trying to make a hologram that works in exactly the same way that the holographic dancer in SJC's Coruscant Adventure map functions. I understand that SJC's hologram is a shader animating .png images. I also figured out that he stretches the proportions of the .png girl to double the normal height, so that the patch that the shader is on can be half of that height. When I create several .png images (even with the same proportions) and create a shader using the exact same methods as SJC's, it doesn't work. The hologram is always the same size as its .png, no matter how large the patch is, and overlaps other gfx. Please help me... :wacko: Edited June 23, 2013 by Vegeta
mrwonko Posted June 23, 2013 Posted June 23, 2013 Welcome to the wonderful world of Alpha Sorting. Basically, you can't have multiple semi-transparent objects or that kind of overlapping problem.There are three workarounds:You can only use additive blending (blendFunc GL_ONE GL_ONE) - addition is commutative to order does not matter, it will look the same. That's how the glass in Jedi Academy works. You can use all-or-nothing transparency (such as in grates), which allows it to be treated like a fully-opaque surface or ignored completely on a per-pixel-level. (Per fragment, really, but let's not get too technical.) You can manually define the draw order using the sort keyword - that obviously requires that your surfaces can only ever be seen in a certain order, so you shouldn't use it on twosided surfaces. You can however use two different shaders for front and back with reversed sort order.Take your pick. If you'd like to learn more about the reasons for this, learn about what the Z-Buffer is used for in computer graphics and how it doesn't work for transparent objects. (The latter is fairly obvious once you understand its purpose.)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now