rikky
09-14-2011, 10:36 PM
Hey guys,
So I've tried every API call I can think of in getting this to work (Blend, BlendFunc, DepthTest, AlphaTest) and still no dice.
I'm making a 3D application with two 'layers'.
The first is a tilted orthographic layer (game world) and the second is a flat orthographic layer (UI).
Both are saved using GL.Accum(AccumOp.Accum, 1f) and retrieved using GL.Accum(AccumOp.Return, 1f).
For the second layer I wrote small methods for binding and drawing textures, as well as drawing basic rectangles (always handy) and they worked great.
The only issue is that when they're not over a plain black surface, they seem to additively blend into the layer behind them instead of opaque/alpha-blending.
When I try GL.Accum(AccumOp.Load, 1f) on the second layer it just paints black over the layer beneath it, so that doesn't help.
http://users.tpg.com.au/bjcohn/voxel/accum0.png - No blending
http://users.tpg.com.au/bjcohn/voxel/accum1.png - Partial
http://users.tpg.com.au/bjcohn/voxel/accum2.png - Full
Can anyone help me out?
I know it must only be a matter of putting the right line in the right place.
Richard
(my syntax may look a little weird as I'm using a C# wrapper, but any C/C++ calls you supply would still be accessible on my end)
So I've tried every API call I can think of in getting this to work (Blend, BlendFunc, DepthTest, AlphaTest) and still no dice.
I'm making a 3D application with two 'layers'.
The first is a tilted orthographic layer (game world) and the second is a flat orthographic layer (UI).
Both are saved using GL.Accum(AccumOp.Accum, 1f) and retrieved using GL.Accum(AccumOp.Return, 1f).
For the second layer I wrote small methods for binding and drawing textures, as well as drawing basic rectangles (always handy) and they worked great.
The only issue is that when they're not over a plain black surface, they seem to additively blend into the layer behind them instead of opaque/alpha-blending.
When I try GL.Accum(AccumOp.Load, 1f) on the second layer it just paints black over the layer beneath it, so that doesn't help.
http://users.tpg.com.au/bjcohn/voxel/accum0.png - No blending
http://users.tpg.com.au/bjcohn/voxel/accum1.png - Partial
http://users.tpg.com.au/bjcohn/voxel/accum2.png - Full
Can anyone help me out?
I know it must only be a matter of putting the right line in the right place.
Richard
(my syntax may look a little weird as I'm using a C# wrapper, but any C/C++ calls you supply would still be accessible on my end)