Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2910/src/net/sourceforge/bprocessor/gl/view
Modified Files:
Display.java
Log Message:
Transparent surfaces rendered without depth-mask
Index: Display.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** Display.java 11 Oct 2007 13:57:28 -0000 1.29
--- Display.java 12 Oct 2007 07:57:53 -0000 1.30
***************
*** 413,416 ****
--- 413,417 ----
paint(current, color, 1.0f, false);
} else if (transparency) {
+
paint(current, color, 0.3f, false);
}
***************
*** 433,438 ****
--- 434,445 ----
private static void paint(Surface surface, float[] color, float alpha, boolean reverse) {
+ if (alpha != 1.0) {
+ gl.glDepthMask(false);
+ }
apply(color, alpha);
draw(surface, reverse);
+ if (alpha != 1.0) {
+ gl.glDepthMask(true);
+ }
}
***************
*** 600,608 ****
}
! private static boolean transparent(Space space) {
! Project project = Project.getInstance();
! Camera camera = project.getCurrentCamera();
Collection<Geometric> hidden = camera.getHiddenGeometrics();
! if (hidden.contains(space)) {
return true;
}
--- 607,617 ----
}
! private static boolean hidden(Space space) {
Collection<Geometric> hidden = camera.getHiddenGeometrics();
! return hidden.contains(space);
! }
!
! private static boolean transparent(Space space) {
! if (hidden(space)) {
return true;
}
***************
*** 619,622 ****
--- 628,632 ----
}
+
private static boolean transparent(Surface surface) {
Space front = surface.getFrontDomain();
***************
*** 625,628 ****
--- 635,644 ----
}
+ private static boolean hidden(Surface surface) {
+ Space front = surface.getFrontDomain();
+ Space back = surface.getBackDomain();
+ return hidden(front) && hidden(back);
+ }
+
private static void draw(Space space, boolean inside) {
Set<Geometric> hidden = new HashSet();
|