Normand Briere
2019-08-13 0cdf3fb57ddea3226f094ba45c836c7e9b123e3a
CameraPane.java
....@@ -173,7 +173,7 @@
173173 static boolean doublesided = false; // true; // reversed normals are awful for conformance
174174 boolean anisotropy = true;
175175 boolean softshadow = true; // slower but better false;
176
- boolean opacityhalo = false;
176
+ boolean opacityhalo = false; // reverse the halo effect (e.g. glass)
177177
178178 boolean macromode = false;
179179
....@@ -17533,10 +17533,14 @@
1753317533 gl.glFlush();
1753417534
1753517535 /**/
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);
1753717537
17538
- float[] pixels = occlusionsizebuffer.array();
17538
+ float[] depths = occlusiondepthbuffer.array();
1753917539
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
+
1754017544 double r = 0, g = 0, b = 0;
1754117545
1754217546 double count = 0;
....@@ -17547,7 +17551,7 @@
1754717551
1754817552 double FACTOR = 1;
1754917553
17550
- for (int i = 0; i < pixels.length; i++)
17554
+ for (int i = 0; i < depths.length; i++)
1755117555 {
1755217556 int x = i / OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
1755317557 int y = i % OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
....@@ -17630,7 +17634,7 @@
1763017634
1763117635 double scale = ray.z; // 1; // cos
1763217636
17633
- float depth = pixels[newindex];
17637
+ float depth = depths[newindex];
1763417638
1763517639 /*
1763617640 int newindex2 = (x + 1) * OCCLUSION_SIZE + y;
....@@ -17827,11 +17831,14 @@
1782717831 static IntBuffer AAbuffer; // = IntBuffer.allocate(MAX_SIZE*MAX_SIZE);
1782817832 static IntBuffer bigAAbuffer;
1782917833 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);
1783117835 static IntBuffer selectsizebuffer = IntBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1783217836 static java.nio.FloatBuffer pointselectsizebuffer = java.nio.FloatBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1783317837 //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
+
1783517842 static BufferedImage bufimage = new BufferedImage(TEX_SIZE, TEX_SIZE, BufferedImage.TYPE_INT_RGB);
1783617843 static BufferedImage textest = new cBufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
1783717844 static java.util.Vector<BufferedImage> billboards = new java.util.Vector<BufferedImage>();