Normand Briere
2019-08-13 c67de8aca04d988179191ccb52461af00125920e
CameraPane.java
....@@ -110,7 +110,9 @@
110110 //private Mat4f spotlightTransform = new Mat4f();
111111 //private Mat4f spotlightInverseTransform = new Mat4f();
112112 static GLContext glcontext = null;
113
- /*static*/ com.sun.opengl.util.texture.Texture cubemap;
113
+ /*static*/ com.sun.opengl.util.texture.Texture cubemap; // Either custom or rgb
114
+ /*static*/ com.sun.opengl.util.texture.Texture cubemapcustom;
115
+ /*static*/ com.sun.opengl.util.texture.Texture cubemaprgb;
114116 boolean reverseUP = false;
115117 static boolean frozen = false;
116118 boolean enablebackspace = false; // patch for back buffer refresh
....@@ -173,7 +175,7 @@
173175 static boolean doublesided = false; // true; // reversed normals are awful for conformance
174176 boolean anisotropy = true;
175177 boolean softshadow = true; // slower but better false;
176
- boolean opacityhalo = false;
178
+ boolean opacityhalo = false; // reverse the halo effect (e.g. glass)
177179
178180 boolean macromode = false;
179181
....@@ -187,6 +189,19 @@
187189 }
188190
189191 private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory();
192
+
193
+ public com.sun.opengl.util.texture.Texture LoadSkybox(String name, String ext, boolean mipmap) throws GLException
194
+ {
195
+ try
196
+ {
197
+ return LoadCubemap(getClass().getClassLoader(), name, ext, mipmap);
198
+ } catch (IOException e)
199
+ {
200
+ System.out.println("NAME = " + name);
201
+ e.printStackTrace(); // throw new RuntimeException(e);
202
+ return null;
203
+ }
204
+ }
190205
191206 void SetAsGLRenderer(boolean b)
192207 {
....@@ -1485,6 +1500,8 @@
14851500 gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
14861501 }
14871502
1503
+ float[] colorV = new float[4];
1504
+
14881505 void SetColor(Object3D obj, Vertex p0)
14891506 {
14901507 CameraPane display = this;
....@@ -1552,8 +1569,6 @@
15521569 {
15531570 return;
15541571 }
1555
-
1556
- float[] colorV = new float[3];
15571572
15581573 if (false) // marked)
15591574 {
....@@ -8346,7 +8361,7 @@
83468361 // else
83478362 // if (!texname.startsWith("/"))
83488363 // texname = "/Users/nbriere/Textures/" + texname;
8349
- if (!FileExists(texname))
8364
+ if (!FileExists(texname) && !texname.startsWith("@"))
83508365 {
83518366 texname = fallbackTextureName;
83528367 }
....@@ -8429,6 +8444,15 @@
84298444 new Exception().printStackTrace();
84308445 } else
84318446 {
8447
+ if (texname.startsWith("@"))
8448
+ {
8449
+ // texturecache = textures.get(texname); // suspicious
8450
+ if (texturecache == null)
8451
+ texturecache = new CacheTexture(GetResourceTexture(texname.substring(1), bump),resolution);
8452
+ else
8453
+ new Exception().printStackTrace();
8454
+ } else
8455
+ {
84328456 if (textureon)
84338457 {
84348458 String cachename = texname;
....@@ -8488,6 +8512,7 @@
84888512 texturecache = new CacheTexture(texturedata,resolution);
84898513 //texture = GetTexture(tex, bump);
84908514 }
8515
+ }
84918516 }
84928517 //}
84938518 }
....@@ -8756,10 +8781,12 @@
87568781
87578782 gl.glGetIntegerv(GL.GL_MAX_TEXTURE_STACK_DEPTH, temp, 0);
87588783 MAXSTACK = temp[0];
8759
- System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
8784
+ if (Globals.DEBUG)
8785
+ System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
87608786 gl.glGetIntegerv(GL.GL_MAX_MODELVIEW_STACK_DEPTH, temp, 0);
87618787 MAXSTACK = temp[0];
8762
- System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
8788
+ if (Globals.DEBUG)
8789
+ System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
87638790
87648791 // Use debug pipeline
87658792 //drawable.setGL(new DebugGL(gl)); //
....@@ -8767,7 +8794,8 @@
87678794 gl = drawable.getGL(); //
87688795
87698796 GL gl3 = getGL();
8770
- System.out.println("INIT GL IS: " + gl.getClass().getName());
8797
+ if (Globals.DEBUG)
8798
+ System.out.println("INIT GL IS: " + gl.getClass().getName());
87718799
87728800
87738801 //float pos[] = { 100, 100, 100, 0 };
....@@ -8932,7 +8960,7 @@
89328960
89338961 if (cubemap == null)
89348962 {
8935
- LoadEnvy(5);
8963
+ //LoadEnvy(1);
89368964 }
89378965
89388966 //cubemap.enable();
....@@ -9208,6 +9236,8 @@
92089236
92099237 void LoadEnvy(int which)
92109238 {
9239
+ assert(false);
9240
+
92119241 String name;
92129242 String ext;
92139243
....@@ -9219,37 +9249,58 @@
92199249 cubemap = null;
92209250 return;
92219251 case 1:
9222
- name = "cubemaps/box_";
9223
- ext = "png";
9252
+ name = "cubemaps/rgb/";
9253
+ ext = "jpg";
92249254 reverseUP = false;
92259255 break;
92269256 case 2:
9227
- name = "cubemaps/uffizi_";
9228
- ext = "png";
9229
- break; // reverseUP = true; break;
9257
+ name = "cubemaps/uffizi/";
9258
+ ext = "jpg";
9259
+ reverseUP = false;
9260
+ break;
92309261 case 3:
9231
- name = "cubemaps/CloudyHills_";
9232
- ext = "tga";
9262
+ name = "cubemaps/CloudyHills/";
9263
+ ext = "jpg";
92339264 reverseUP = false;
92349265 break;
92359266 case 4:
9236
- name = "cubemaps/cornell_";
9267
+ name = "cubemaps/cornell/";
92379268 ext = "png";
92389269 reverseUP = false;
92399270 break;
9271
+ case 5:
9272
+ name = "cubemaps/skycube/";
9273
+ ext = "jpg";
9274
+ reverseUP = false;
9275
+ break;
9276
+ case 6:
9277
+ name = "cubemaps/SaintLazarusChurch3/";
9278
+ ext = "jpg";
9279
+ reverseUP = false;
9280
+ break;
9281
+ case 7:
9282
+ name = "cubemaps/Sodermalmsallen/";
9283
+ ext = "jpg";
9284
+ reverseUP = false;
9285
+ break;
9286
+ case 8:
9287
+ name = "cubemaps/Sodermalmsallen2/";
9288
+ ext = "jpg";
9289
+ reverseUP = false;
9290
+ break;
9291
+ case 9:
9292
+ name = "cubemaps/UnionSquare/";
9293
+ ext = "jpg";
9294
+ reverseUP = false;
9295
+ break;
92409296 default:
9241
- name = "cubemaps/rgb_";
9242
- ext = "png"; /*mipmap = true;*/ reverseUP = false;
9297
+ name = "cubemaps/box/";
9298
+ ext = "png"; /*mipmap = true;*/
9299
+ reverseUP = false;
92439300 break;
92449301 }
9245
-
9246
- try
9247
- {
9248
- cubemap = LoadCubemap(getClass().getClassLoader(), name, ext, mipmap);
9249
- } catch (IOException e)
9250
- {
9251
- throw new RuntimeException(e);
9252
- }
9302
+
9303
+ LoadSkybox(name, ext, mipmap);
92539304 }
92549305
92559306 public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
....@@ -9281,8 +9332,12 @@
92819332 static double[] model = new double[16];
92829333 double[] camera2light = new double[16];
92839334 double[] light2camera = new double[16];
9284
- int newenvy = -1;
9285
- boolean envyoff = true; // false;
9335
+
9336
+ //int newenvy = -1;
9337
+ //boolean envyoff = false;
9338
+
9339
+ String loadedskyboxname;
9340
+
92869341 cVector light0 = new cVector(0, 0, 0); // 1,3,2);
92879342 //float[] light0 = { 0,0,0 };
92889343 cVector dirlight = new cVector(0, 0, 1); // 1,3,2);
....@@ -9762,10 +9817,12 @@
97629817 rati = 1 / rati;
97639818 gl.glOrtho(-skyscale / rati, skyscale / rati, -skyscale, skyscale, 0.001, 1000);
97649819 }
9765
- assert (newenvy == -1);
9820
+
9821
+ //assert (newenvy == -1);
9822
+
97669823 gl.glDisable(GL.GL_FRAGMENT_PROGRAM_ARB);
97679824 gl.glDisable(GL.GL_VERTEX_PROGRAM_ARB);
9768
- DrawSkyBox(gl);
9825
+ DrawSkyBox(gl, (float)rati);
97699826 gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB);
97709827 gl.glEnable(GL.GL_VERTEX_PROGRAM_ARB);
97719828 accPerspective(gl, renderCamera.shaper_fovy / ratio,
....@@ -10802,7 +10859,7 @@
1080210859
1080310860 if (wait)
1080410861 {
10805
- Sleep(500);
10862
+ Sleep(200); // blocks everything
1080610863
1080710864 wait = false;
1080810865 }
....@@ -11018,13 +11075,41 @@
1101811075 gl.glOrtho(-skyscale / ratio, skyscale / ratio, -skyscale, skyscale, 0.001, 1000);
1101911076 }
1102011077
11021
- if (newenvy > -1)
11078
+// if (newenvy > -1)
11079
+// {
11080
+// LoadEnvy(newenvy);
11081
+// }
11082
+//
11083
+// newenvy = -1;
11084
+
11085
+ if (object.skyboxname != null && object.skyboxname.equals("cubemaps/default-skyboxes/rgb"))
1102211086 {
11023
- LoadEnvy(newenvy);
11087
+ if (cubemaprgb == null)
11088
+ {
11089
+ cubemaprgb = LoadSkybox(object.skyboxname + "/", object.skyboxext, false);
11090
+ }
11091
+
11092
+ cubemap = cubemaprgb;
1102411093 }
11025
-
11026
- newenvy = -1;
11027
-
11094
+ else
11095
+ {
11096
+ if (object.skyboxname != null)
11097
+ {
11098
+ if (!object.skyboxname.equals(this.loadedskyboxname))
11099
+ {
11100
+ cubemapcustom = LoadSkybox(object.skyboxname + "/", object.skyboxext, false);
11101
+ loadedskyboxname = object.skyboxname;
11102
+ }
11103
+ }
11104
+ else
11105
+ {
11106
+ cubemapcustom = null;
11107
+ loadedskyboxname = null;
11108
+ }
11109
+
11110
+ cubemap = cubemapcustom;
11111
+ }
11112
+
1102811113 ratio = ((double) getWidth()) / getHeight();
1102911114 //System.out.println("ratio = " + ratio);
1103011115
....@@ -11040,7 +11125,7 @@
1104011125
1104111126 if (!IsFrozen() && !ambientOcclusion)
1104211127 {
11043
- DrawSkyBox(gl);
11128
+ DrawSkyBox(gl, (float)ratio);
1104411129 }
1104511130
1104611131 //if (selection_view == -1)
....@@ -11326,7 +11411,7 @@
1132611411
1132711412 // if (cam != lightCamera)
1132811413 //for (int count = parentcam.GetTransformCount(); --count>=0;)
11329
- LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013
11414
+ LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013
1133011415 }
1133111416
1133211417 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -12400,7 +12485,7 @@
1240012485
1240112486 //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0);
1240212487
12403
- String program =
12488
+ String programmin =
1240412489 // Min shader
1240512490 "!!ARBfp1.0\n" +
1240612491 "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" +
....@@ -12451,7 +12536,8 @@
1245112536 //"SUB ndotl.y, zero123.y, ndotl.y;" +
1245212537 //"MUL ndotl.y, ndotl.y, pow2.z;" +
1245312538
12454
- "MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient
12539
+ //"MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient
12540
+ //"MAX ndotl.x, ndotl.x, pow2.y;" + // Ambient
1245512541
1245612542 // Pigment
1245712543 "TEX temp, fragment.texcoord[0], texture[0], 2D;" +
....@@ -12466,7 +12552,7 @@
1246612552 "MOV result.color, temp;" +
1246712553 "END";
1246812554
12469
- String program2 =
12555
+ String programmax =
1247012556 "!!ARBfp1.0\n" +
1247112557
1247212558 //"OPTION ARB_fragment_program_shadow;" +
....@@ -12991,7 +13077,7 @@
1299113077 // display shadow only (fakedepth == 0)
1299213078 "SUB temp.x, half.x, shadow.x;" +
1299313079 "MOV temp.y, -params5.z;" + // params6.x;" +
12994
- "SLT temp.z, temp.y, -one2048th.x;" +
13080
+ "SLT temp.z, temp.y, -c256i.x;" +
1299513081 "SUB temp.y, one.x, temp.z;" +
1299613082 "MUL temp.x, temp.x, temp.y;" +
1299713083 "KIL temp.x;" +
....@@ -13322,6 +13408,13 @@
1332213408 //once = true;
1332313409 }
1332413410
13411
+ String program = programmax;
13412
+
13413
+ if (Globals.MINSHADER)
13414
+ {
13415
+ program = programmin;
13416
+ }
13417
+
1332513418 System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1332613419 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1332713420 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
....@@ -14571,9 +14664,9 @@
1457114664 MODIFIERS |= COMMAND;
1457214665 /**/
1457314666 if((mod&SHIFT) == SHIFT)
14574
- manipCamera.RotatePosition(0, -speed);
14575
- else
1457614667 manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14668
+ else
14669
+ manipCamera.RotatePosition(0, -speed);
1457714670 /**/
1457814671 if ((mod & SHIFT) == SHIFT)
1457914672 {
....@@ -14592,9 +14685,9 @@
1459214685 MODIFIERS |= COMMAND;
1459314686 /**/
1459414687 if((mod&SHIFT) == SHIFT)
14595
- manipCamera.RotatePosition(0, speed);
14596
- else
1459714688 manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14689
+ else
14690
+ manipCamera.RotatePosition(0, speed);
1459814691 /**/
1459914692 if ((mod & SHIFT) == SHIFT)
1460014693 {
....@@ -15315,20 +15408,24 @@
1531515408 OCCLUSION_CULLING ^= true;
1531615409 System.out.println("OCCLUSION CULLING = " + OCCLUSION_CULLING);
1531715410 break;
15318
- case '0': envyoff ^= true; repaint(); break;
15411
+ //case '0': envyoff ^= true; repaint(); break;
1531915412 case '1':
1532015413 case '2':
1532115414 case '3':
1532215415 case '4':
1532315416 case '5':
15324
- newenvy = Character.getNumericValue(key);
15325
- repaint();
15326
- break;
1532715417 case '6':
1532815418 case '7':
1532915419 case '8':
1533015420 case '9':
15331
- BGcolor = (key - '6')/3.f;
15421
+ if (true) // envyoff)
15422
+ {
15423
+ BGcolor = (key - '1')/8.f;
15424
+ }
15425
+ else
15426
+ {
15427
+ //newenvy = Character.getNumericValue(key);
15428
+ }
1533215429 repaint();
1533315430 break;
1533415431 case '!':
....@@ -16033,7 +16130,7 @@
1603316130 gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1603416131 break;
1603516132 case Object3D.hitScale: gr.setColor(Color.cyan);
16036
- gr.drawLine(X, Y, 0, 0);
16133
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1603716134 break;
1603816135 }
1603916136
....@@ -16519,6 +16616,8 @@
1651916616 private /*static*/ boolean firstime;
1652016617 private /*static*/ cVector newView = new cVector();
1652116618 private static final String[] suffixes = {"posx", "negx", "posy", "negy", "posz", "negz"};
16619
+ private static final String[] suffixes2 = {"east", "west", "top", "bottom", "north", "south"};
16620
+ private static final String[] suffixes3 = {"ft", "bk", "up", "dn", "rt", "lf"};
1652216621 private static final int[] targets = {GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
1652316622 GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
1652416623 GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
....@@ -16531,29 +16630,67 @@
1653116630 {
1653216631 com.sun.opengl.util.texture.Texture cubemap = TextureIO.newTexture(GL.GL_TEXTURE_CUBE_MAP);
1653316632
16633
+ int usedsuf = 0;
16634
+
1653416635 for (int i = 0; i < suffixes.length; i++)
1653516636 {
16536
- String resourceName = basename + suffixes[i] + "." + suffix;
16537
- TextureData data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16538
- mipmapped,
16539
- FileUtil.getFileSuffix(resourceName));
16540
- if (data == null)
16637
+ String[] suffixe = suffixes;
16638
+ String[] fallback = suffixes2;
16639
+ String[] fallfallback = suffixes3;
16640
+
16641
+ for (int c=usedsuf; --c>=0;)
1654116642 {
16542
- throw new IOException("Unable to load texture " + resourceName);
16643
+// String[] temp = suffixe;
16644
+// suffixe = fallback;
16645
+// fallback = fallfallback;
16646
+// fallfallback = temp;
1654316647 }
16648
+
16649
+ String resourceName = basename + suffixe[i] + "." + suffix;
16650
+ TextureData data;
16651
+
16652
+ try
16653
+ {
16654
+ data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16655
+ mipmapped,
16656
+ FileUtil.getFileSuffix(resourceName));
16657
+ }
16658
+ catch (Exception e)
16659
+ {
16660
+ try
16661
+ {
16662
+ resourceName = basename + fallback[i] + "." + suffix;
16663
+ data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16664
+ mipmapped,
16665
+ FileUtil.getFileSuffix(resourceName));
16666
+ }
16667
+ catch (Exception e2)
16668
+ {
16669
+ resourceName = basename + fallfallback[i] + "." + suffix;
16670
+ data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16671
+ mipmapped,
16672
+ FileUtil.getFileSuffix(resourceName));
16673
+ }
16674
+ }
16675
+
1654416676 //System.out.println("Target = " + targets[i]);
1654516677 cubemap.updateImage(data, targets[i]);
1654616678 }
1654716679
1654816680 return cubemap;
1654916681 }
16682
+
1655016683 int bigsphere = -1;
1655116684
1655216685 float BGcolor = 0.5f;
1655316686
16554
- private void DrawSkyBox(GL gl)
16687
+ float ambientLight[] = {1f, 1f, 1f, 1.0f};
16688
+
16689
+ private void DrawSkyBox(GL gl, float ratio)
1655516690 {
16556
- if (envyoff || cubemap == null)
16691
+ if (//envyoff ||
16692
+ WIREFRAME ||
16693
+ cubemap == null)
1655716694 {
1655816695 gl.glClearColor(BGcolor, BGcolor, BGcolor, 1);
1655916696 gl.glClear(gl.GL_COLOR_BUFFER_BIT);
....@@ -16568,7 +16705,17 @@
1656816705 // Compensates for ExaminerViewer's modification of modelview matrix
1656916706 gl.glMatrixMode(GL.GL_MODELVIEW);
1657016707 gl.glLoadIdentity();
16708
+ gl.glScalef(1,ratio,1);
1657116709
16710
+// colorV[0] = 2;
16711
+// colorV[1] = 2;
16712
+// colorV[2] = 2;
16713
+// colorV[3] = 1;
16714
+// gl.glDisable(gl.GL_COLOR_MATERIAL);
16715
+// gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0);
16716
+//
16717
+// gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0);
16718
+
1657216719 //gl.glActiveTexture(GL.GL_TEXTURE1);
1657316720 //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP);
1657416721
....@@ -16600,6 +16747,7 @@
1660016747 {
1660116748 gl.glScalef(1.0f, -1.0f, 1.0f);
1660216749 }
16750
+ gl.glScalef(-1.0f, 1.0f, 1.0f);
1660316751 gl.glMultMatrixd(viewrot_1, 0);
1660416752 gl.glTranslatef(0, 0, 0.5f); // (float)lightCamera.Distance()); // 0.5f);
1660516753 //viewer.updateInverseRotation(gl);
....@@ -16858,7 +17006,7 @@
1685817006 //new Exception().printStackTrace();
1685917007 System.out.println("select buffer init");
1686017008 // Use debug pipeline
16861
- drawable.setGL(new DebugGL(drawable.getGL()));
17009
+ //drawable.setGL(new DebugGL(drawable.getGL()));
1686217010
1686317011 GL gl = drawable.getGL();
1686417012
....@@ -17404,10 +17552,14 @@
1740417552 gl.glFlush();
1740517553
1740617554 /**/
17407
- gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusionsizebuffer);
17555
+ gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusiondepthbuffer);
1740817556
17409
- float[] pixels = occlusionsizebuffer.array();
17557
+ float[] depths = occlusiondepthbuffer.array();
1741017558
17559
+ gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_BGRA, GL.GL_UNSIGNED_INT_8_8_8_8_REV, occlusioncolorbuffer);
17560
+
17561
+ int[] pixels = selectsizebuffer.array();
17562
+
1741117563 double r = 0, g = 0, b = 0;
1741217564
1741317565 double count = 0;
....@@ -17418,7 +17570,7 @@
1741817570
1741917571 double FACTOR = 1;
1742017572
17421
- for (int i = 0; i < pixels.length; i++)
17573
+ for (int i = 0; i < depths.length; i++)
1742217574 {
1742317575 int x = i / OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
1742417576 int y = i % OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
....@@ -17501,7 +17653,7 @@
1750117653
1750217654 double scale = ray.z; // 1; // cos
1750317655
17504
- float depth = pixels[newindex];
17656
+ float depth = depths[newindex];
1750517657
1750617658 /*
1750717659 int newindex2 = (x + 1) * OCCLUSION_SIZE + y;
....@@ -17698,11 +17850,14 @@
1769817850 static IntBuffer AAbuffer; // = IntBuffer.allocate(MAX_SIZE*MAX_SIZE);
1769917851 static IntBuffer bigAAbuffer;
1770017852 static java.nio.FloatBuffer histogram = BufferUtil.newFloatBuffer(HISTOGRAM_SIZE * 3);
17701
- static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);
17853
+ //static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);
1770217854 static IntBuffer selectsizebuffer = IntBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1770317855 static java.nio.FloatBuffer pointselectsizebuffer = java.nio.FloatBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1770417856 //static IntBuffer occlusionsizebuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17705
- static java.nio.FloatBuffer occlusionsizebuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17857
+ static java.nio.FloatBuffer occlusiondepthbuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17858
+
17859
+ static IntBuffer occlusioncolorbuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17860
+
1770617861 static BufferedImage bufimage = new BufferedImage(TEX_SIZE, TEX_SIZE, BufferedImage.TYPE_INT_RGB);
1770717862 static BufferedImage textest = new cBufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
1770817863 static java.util.Vector<BufferedImage> billboards = new java.util.Vector<BufferedImage>();