Jump to content

Holographic Shader


Recommended Posts

Posted (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:

 

 

shot0001.jpg

 

shot0000.jpg

 

shot0002.jpg

 

 

Edited by Vegeta
Posted

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:

  1. 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.
  2. 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.)
  3. 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.)

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
×
×
  • Create New...