.. | .. |
---|
173 | 173 | static boolean doublesided = false; // true; // reversed normals are awful for conformance |
---|
174 | 174 | boolean anisotropy = true; |
---|
175 | 175 | boolean softshadow = true; // slower but better false; |
---|
176 | | - boolean opacityhalo = false; |
---|
| 176 | + boolean opacityhalo = false; // reverse the halo effect (e.g. glass) |
---|
177 | 177 | |
---|
178 | 178 | boolean macromode = false; |
---|
179 | 179 | |
---|
.. | .. |
---|
17533 | 17533 | gl.glFlush(); |
---|
17534 | 17534 | |
---|
17535 | 17535 | /**/ |
---|
17536 | | - gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusionsizebuffer); |
---|
| 17536 | + gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusiondepthbuffer); |
---|
17537 | 17537 | |
---|
17538 | | - float[] pixels = occlusionsizebuffer.array(); |
---|
| 17538 | + float[] depths = occlusiondepthbuffer.array(); |
---|
17539 | 17539 | |
---|
| 17540 | + gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_BGRA, GL.GL_UNSIGNED_INT_8_8_8_8_REV, occlusioncolorbuffer); |
---|
| 17541 | + |
---|
| 17542 | + int[] pixels = selectsizebuffer.array(); |
---|
| 17543 | + |
---|
17540 | 17544 | double r = 0, g = 0, b = 0; |
---|
17541 | 17545 | |
---|
17542 | 17546 | double count = 0; |
---|
.. | .. |
---|
17547 | 17551 | |
---|
17548 | 17552 | double FACTOR = 1; |
---|
17549 | 17553 | |
---|
17550 | | - for (int i = 0; i < pixels.length; i++) |
---|
| 17554 | + for (int i = 0; i < depths.length; i++) |
---|
17551 | 17555 | { |
---|
17552 | 17556 | int x = i / OCCLUSION_SIZE - OCCLUSION_SIZE / 2; |
---|
17553 | 17557 | int y = i % OCCLUSION_SIZE - OCCLUSION_SIZE / 2; |
---|
.. | .. |
---|
17630 | 17634 | |
---|
17631 | 17635 | double scale = ray.z; // 1; // cos |
---|
17632 | 17636 | |
---|
17633 | | - float depth = pixels[newindex]; |
---|
| 17637 | + float depth = depths[newindex]; |
---|
17634 | 17638 | |
---|
17635 | 17639 | /* |
---|
17636 | 17640 | int newindex2 = (x + 1) * OCCLUSION_SIZE + y; |
---|
.. | .. |
---|
17827 | 17831 | static IntBuffer AAbuffer; // = IntBuffer.allocate(MAX_SIZE*MAX_SIZE); |
---|
17828 | 17832 | static IntBuffer bigAAbuffer; |
---|
17829 | 17833 | static java.nio.FloatBuffer histogram = BufferUtil.newFloatBuffer(HISTOGRAM_SIZE * 3); |
---|
17830 | | - static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE); |
---|
| 17834 | + //static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE); |
---|
17831 | 17835 | static IntBuffer selectsizebuffer = IntBuffer.allocate(SELECT_SIZE * SELECT_SIZE); |
---|
17832 | 17836 | static java.nio.FloatBuffer pointselectsizebuffer = java.nio.FloatBuffer.allocate(SELECT_SIZE * SELECT_SIZE); |
---|
17833 | 17837 | //static IntBuffer occlusionsizebuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); |
---|
17834 | | - static java.nio.FloatBuffer occlusionsizebuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); |
---|
| 17838 | + static java.nio.FloatBuffer occlusiondepthbuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); |
---|
| 17839 | + |
---|
| 17840 | + static IntBuffer occlusioncolorbuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); |
---|
| 17841 | + |
---|
17835 | 17842 | static BufferedImage bufimage = new BufferedImage(TEX_SIZE, TEX_SIZE, BufferedImage.TYPE_INT_RGB); |
---|
17836 | 17843 | static BufferedImage textest = new cBufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); |
---|
17837 | 17844 | static java.util.Vector<BufferedImage> billboards = new java.util.Vector<BufferedImage>(); |
---|