|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.video.multipass.TranslucentPass
public class TranslucentPass
TranslucentPass is used for drawing objects that are translucent, optionally
by using the Painter's Algorithm. This is necessary because translucent
objects cannot be drawn properly using the OpenGL Z buffer, so they must
instead be sorted using the Painter's Algorithm before drawing them.
The Painter's Algorithm involves drawing objects in order from most
distant to closest, just as a painter paints on a canvas. Using the
Painter's Algorithm takes O(n log n) time to render n objects, as opposed to
O(n); it's not much of a performance hit, but if you're not concerned with
things looking absolutely perfect, you can get a higher frame rate by turning
this option off.
API Stability: Beta.
Constructor Summary | |
---|---|
TranslucentPass()
This is the same as TranslucentPass(true). |
|
TranslucentPass(boolean paintersMode)
Constructs a new TranslucentPass. |
Method Summary | |
---|---|
void |
addTranslucent(Context c,
Translucent t)
Adds a Translucent to this Pass for use with the Painter's Algorithm. |
void |
begin(Context c)
Begins this TranslucentPass by setting the OpenGL depth mask to false. |
void |
end(Context c)
Ends this TranslucentPass by setting the OpenGL depth mask to true after any collected Translucent objects are drawn using the Painter's Algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TranslucentPass(boolean paintersMode)
paintersMode
- If true, then the Translucent instances submitted for
rendering via the addTranslucent(Translucent) method will be drawn in the
order specified by the Painter's Algorithm. If false, then they'll be
drawn in their natural order.public TranslucentPass()
Method Detail |
---|
public void begin(Context c)
begin
in interface Pass
public void addTranslucent(Context c, Translucent t)
java.lang.IllegalStateException
- if this pass has not started.public void end(Context c)
end
in interface Pass
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |