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
....@@ -8778,10 +8778,12 @@
87788778
87798779 gl.glGetIntegerv(GL.GL_MAX_TEXTURE_STACK_DEPTH, temp, 0);
87808780 MAXSTACK = temp[0];
8781
- System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
8781
+ if (Globals.DEBUG)
8782
+ System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
87828783 gl.glGetIntegerv(GL.GL_MAX_MODELVIEW_STACK_DEPTH, temp, 0);
87838784 MAXSTACK = temp[0];
8784
- System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
8785
+ if (Globals.DEBUG)
8786
+ System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
87858787
87868788 // Use debug pipeline
87878789 //drawable.setGL(new DebugGL(gl)); //
....@@ -8789,7 +8791,8 @@
87898791 gl = drawable.getGL(); //
87908792
87918793 GL gl3 = getGL();
8792
- System.out.println("INIT GL IS: " + gl.getClass().getName());
8794
+ if (Globals.DEBUG)
8795
+ System.out.println("INIT GL IS: " + gl.getClass().getName());
87938796
87948797
87958798 //float pos[] = { 100, 100, 100, 0 };
....@@ -16667,6 +16670,7 @@
1666716670 private void DrawSkyBox(GL gl, float ratio)
1666816671 {
1666916672 if (//envyoff ||
16673
+ WIREFRAME ||
1667016674 cubemap == null)
1667116675 {
1667216676 gl.glClearColor(BGcolor, BGcolor, BGcolor, 1);
....@@ -17529,10 +17533,14 @@
1752917533 gl.glFlush();
1753017534
1753117535 /**/
17532
- 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);
1753317537
17534
- float[] pixels = occlusionsizebuffer.array();
17538
+ float[] depths = occlusiondepthbuffer.array();
1753517539
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
+
1753617544 double r = 0, g = 0, b = 0;
1753717545
1753817546 double count = 0;
....@@ -17543,7 +17551,7 @@
1754317551
1754417552 double FACTOR = 1;
1754517553
17546
- for (int i = 0; i < pixels.length; i++)
17554
+ for (int i = 0; i < depths.length; i++)
1754717555 {
1754817556 int x = i / OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
1754917557 int y = i % OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
....@@ -17626,7 +17634,7 @@
1762617634
1762717635 double scale = ray.z; // 1; // cos
1762817636
17629
- float depth = pixels[newindex];
17637
+ float depth = depths[newindex];
1763017638
1763117639 /*
1763217640 int newindex2 = (x + 1) * OCCLUSION_SIZE + y;
....@@ -17823,11 +17831,14 @@
1782317831 static IntBuffer AAbuffer; // = IntBuffer.allocate(MAX_SIZE*MAX_SIZE);
1782417832 static IntBuffer bigAAbuffer;
1782517833 static java.nio.FloatBuffer histogram = BufferUtil.newFloatBuffer(HISTOGRAM_SIZE * 3);
17826
- static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);
17834
+ //static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);
1782717835 static IntBuffer selectsizebuffer = IntBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1782817836 static java.nio.FloatBuffer pointselectsizebuffer = java.nio.FloatBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1782917837 //static IntBuffer occlusionsizebuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17830
- 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
+
1783117842 static BufferedImage bufimage = new BufferedImage(TEX_SIZE, TEX_SIZE, BufferedImage.TYPE_INT_RGB);
1783217843 static BufferedImage textest = new cBufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
1783317844 static java.util.Vector<BufferedImage> billboards = new java.util.Vector<BufferedImage>();