Normand Briere
2019-08-17 ecc1309a04b527c62ffe97e814daf050dbd025cd
CameraPane.java
....@@ -110,7 +110,11 @@
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;
116
+ boolean transformMode;
117
+
114118 boolean reverseUP = false;
115119 static boolean frozen = false;
116120 boolean enablebackspace = false; // patch for back buffer refresh
....@@ -164,7 +168,7 @@
164168
165169
166170 // OPTIONS
167
- boolean Skinshader = true;
171
+ boolean Skinshader = false; // true;
168172 boolean cameraLight = false;
169173 boolean UVdebug = false;
170174 boolean Udebug = false;
....@@ -173,7 +177,7 @@
173177 static boolean doublesided = false; // true; // reversed normals are awful for conformance
174178 boolean anisotropy = true;
175179 boolean softshadow = true; // slower but better false;
176
- boolean opacityhalo = false;
180
+ boolean opacityhalo = false; // reverse the halo effect (e.g. glass)
177181
178182 boolean macromode = false;
179183
....@@ -187,6 +191,19 @@
187191 }
188192
189193 private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory();
194
+
195
+ public com.sun.opengl.util.texture.Texture LoadSkybox(String name, String ext, boolean mipmap) throws GLException
196
+ {
197
+ try
198
+ {
199
+ return LoadCubemap(getClass().getClassLoader(), name, ext, mipmap);
200
+ } catch (IOException e)
201
+ {
202
+ System.out.println("NAME = " + name);
203
+ e.printStackTrace(); // throw new RuntimeException(e);
204
+ return null;
205
+ }
206
+ }
190207
191208 void SetAsGLRenderer(boolean b)
192209 {
....@@ -206,7 +223,8 @@
206223
207224 SetCamera(cam);
208225
209
- SetLight(new Camera(new cVector(10, 10, -20)));
226
+ // Warning: not used.
227
+ SetLight(new Camera(new cVector(15, 10, -20)));
210228
211229 object = o;
212230
....@@ -1484,6 +1502,8 @@
14841502 gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
14851503 }
14861504
1505
+ float[] colorV = new float[4];
1506
+
14871507 void SetColor(Object3D obj, Vertex p0)
14881508 {
14891509 CameraPane display = this;
....@@ -1551,8 +1571,6 @@
15511571 {
15521572 return;
15531573 }
1554
-
1555
- float[] colorV = new float[3];
15561574
15571575 if (false) // marked)
15581576 {
....@@ -2499,7 +2517,7 @@
24992517 com.sun.opengl.util.texture.TextureIO.newTextureData(
25002518 getClass().getClassLoader().getResourceAsStream(name),
25012519 true,
2502
- com.sun.opengl.util.texture.TextureIO.PNG);
2520
+ GetFormat(name)); // com.sun.opengl.util.texture.TextureIO.PNG);
25032521 } catch (java.io.IOException e)
25042522 {
25052523 throw new javax.media.opengl.GLException(e);
....@@ -8345,7 +8363,7 @@
83458363 // else
83468364 // if (!texname.startsWith("/"))
83478365 // texname = "/Users/nbriere/Textures/" + texname;
8348
- if (!FileExists(texname))
8366
+ if (!FileExists(texname) && !texname.startsWith("@"))
83498367 {
83508368 texname = fallbackTextureName;
83518369 }
....@@ -8428,6 +8446,15 @@
84288446 new Exception().printStackTrace();
84298447 } else
84308448 {
8449
+ if (texname.startsWith("@"))
8450
+ {
8451
+ // texturecache = textures.get(texname); // suspicious
8452
+ if (texturecache == null)
8453
+ texturecache = new CacheTexture(GetResourceTexture(texname.substring(1), bump),resolution);
8454
+ else
8455
+ new Exception().printStackTrace();
8456
+ } else
8457
+ {
84318458 if (textureon)
84328459 {
84338460 String cachename = texname;
....@@ -8487,6 +8514,7 @@
84878514 texturecache = new CacheTexture(texturedata,resolution);
84888515 //texture = GetTexture(tex, bump);
84898516 }
8517
+ }
84908518 }
84918519 //}
84928520 }
....@@ -8755,10 +8783,12 @@
87558783
87568784 gl.glGetIntegerv(GL.GL_MAX_TEXTURE_STACK_DEPTH, temp, 0);
87578785 MAXSTACK = temp[0];
8758
- System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
8786
+ if (Globals.DEBUG)
8787
+ System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
87598788 gl.glGetIntegerv(GL.GL_MAX_MODELVIEW_STACK_DEPTH, temp, 0);
87608789 MAXSTACK = temp[0];
8761
- System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
8790
+ if (Globals.DEBUG)
8791
+ System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
87628792
87638793 // Use debug pipeline
87648794 //drawable.setGL(new DebugGL(gl)); //
....@@ -8766,7 +8796,8 @@
87668796 gl = drawable.getGL(); //
87678797
87688798 GL gl3 = getGL();
8769
- System.out.println("INIT GL IS: " + gl.getClass().getName());
8799
+ if (Globals.DEBUG)
8800
+ System.out.println("INIT GL IS: " + gl.getClass().getName());
87708801
87718802
87728803 //float pos[] = { 100, 100, 100, 0 };
....@@ -8931,7 +8962,7 @@
89318962
89328963 if (cubemap == null)
89338964 {
8934
- LoadEnvy(5);
8965
+ //LoadEnvy(1);
89358966 }
89368967
89378968 //cubemap.enable();
....@@ -9207,6 +9238,8 @@
92079238
92089239 void LoadEnvy(int which)
92099240 {
9241
+ assert(false);
9242
+
92109243 String name;
92119244 String ext;
92129245
....@@ -9218,37 +9251,58 @@
92189251 cubemap = null;
92199252 return;
92209253 case 1:
9221
- name = "cubemaps/box_";
9222
- ext = "png";
9254
+ name = "cubemaps/rgb/";
9255
+ ext = "jpg";
92239256 reverseUP = false;
92249257 break;
92259258 case 2:
9226
- name = "cubemaps/uffizi_";
9227
- ext = "png";
9228
- break; // reverseUP = true; break;
9259
+ name = "cubemaps/uffizi/";
9260
+ ext = "jpg";
9261
+ reverseUP = false;
9262
+ break;
92299263 case 3:
9230
- name = "cubemaps/CloudyHills_";
9231
- ext = "tga";
9264
+ name = "cubemaps/CloudyHills/";
9265
+ ext = "jpg";
92329266 reverseUP = false;
92339267 break;
92349268 case 4:
9235
- name = "cubemaps/cornell_";
9269
+ name = "cubemaps/cornell/";
92369270 ext = "png";
92379271 reverseUP = false;
92389272 break;
9273
+ case 5:
9274
+ name = "cubemaps/skycube/";
9275
+ ext = "jpg";
9276
+ reverseUP = false;
9277
+ break;
9278
+ case 6:
9279
+ name = "cubemaps/SaintLazarusChurch3/";
9280
+ ext = "jpg";
9281
+ reverseUP = false;
9282
+ break;
9283
+ case 7:
9284
+ name = "cubemaps/Sodermalmsallen/";
9285
+ ext = "jpg";
9286
+ reverseUP = false;
9287
+ break;
9288
+ case 8:
9289
+ name = "cubemaps/Sodermalmsallen2/";
9290
+ ext = "jpg";
9291
+ reverseUP = false;
9292
+ break;
9293
+ case 9:
9294
+ name = "cubemaps/UnionSquare/";
9295
+ ext = "jpg";
9296
+ reverseUP = false;
9297
+ break;
92399298 default:
9240
- name = "cubemaps/rgb_";
9241
- ext = "png"; /*mipmap = true;*/ reverseUP = false;
9299
+ name = "cubemaps/box/";
9300
+ ext = "png"; /*mipmap = true;*/
9301
+ reverseUP = false;
92429302 break;
92439303 }
9244
-
9245
- try
9246
- {
9247
- cubemap = LoadCubemap(getClass().getClassLoader(), name, ext, mipmap);
9248
- } catch (IOException e)
9249
- {
9250
- throw new RuntimeException(e);
9251
- }
9304
+
9305
+ LoadSkybox(name, ext, mipmap);
92529306 }
92539307
92549308 public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
....@@ -9280,8 +9334,12 @@
92809334 static double[] model = new double[16];
92819335 double[] camera2light = new double[16];
92829336 double[] light2camera = new double[16];
9283
- int newenvy = -1;
9284
- boolean envyoff = true; // false;
9337
+
9338
+ //int newenvy = -1;
9339
+ //boolean envyoff = false;
9340
+
9341
+ String loadedskyboxname;
9342
+
92859343 cVector light0 = new cVector(0, 0, 0); // 1,3,2);
92869344 //float[] light0 = { 0,0,0 };
92879345 cVector dirlight = new cVector(0, 0, 1); // 1,3,2);
....@@ -9699,7 +9757,7 @@
96999757
97009758 if (renderCamera != lightCamera)
97019759 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9702
- LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
9760
+ LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
97039761
97049762 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
97059763
....@@ -9715,7 +9773,7 @@
97159773
97169774 if (renderCamera != lightCamera)
97179775 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9718
- LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
9776
+ LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
97199777
97209778 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
97219779
....@@ -9761,10 +9819,12 @@
97619819 rati = 1 / rati;
97629820 gl.glOrtho(-skyscale / rati, skyscale / rati, -skyscale, skyscale, 0.001, 1000);
97639821 }
9764
- assert (newenvy == -1);
9822
+
9823
+ //assert (newenvy == -1);
9824
+
97659825 gl.glDisable(GL.GL_FRAGMENT_PROGRAM_ARB);
97669826 gl.glDisable(GL.GL_VERTEX_PROGRAM_ARB);
9767
- DrawSkyBox(gl);
9827
+ DrawSkyBox(gl, (float)rati);
97689828 gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB);
97699829 gl.glEnable(GL.GL_VERTEX_PROGRAM_ARB);
97709830 accPerspective(gl, renderCamera.shaper_fovy / ratio,
....@@ -10630,9 +10690,18 @@
1063010690 static boolean init = false;
1063110691
1063210692 double[][] matrix = LA.newMatrix();
10693
+
10694
+ // This is to refresh the UI of the material panel.
10695
+ ObjEditor patchMaterial;
1063310696
1063410697 public void display(GLAutoDrawable drawable)
1063510698 {
10699
+ if (patchMaterial.patchMaterial)
10700
+ {
10701
+ patchMaterial.patchMaterial = false;
10702
+ patchMaterial.objectPanel.setSelectedIndex(0);
10703
+ }
10704
+
1063610705 if (Grafreed.savesound && Grafreed.hassound)
1063710706 {
1063810707 Grafreed.wav.save();
....@@ -10801,7 +10870,7 @@
1080110870
1080210871 if (wait)
1080310872 {
10804
- Sleep(500);
10873
+ Sleep(200); // blocks everything
1080510874
1080610875 wait = false;
1080710876 }
....@@ -10916,7 +10985,7 @@
1091610985 // if (parentcam != renderCamera) // not a light
1091710986 if (cam != lightCamera)
1091810987 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10919
- LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
10988
+ LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
1092010989
1092110990 for (int j = 0; j < 4; j++)
1092210991 {
....@@ -10931,7 +11000,7 @@
1093111000 // if (parentcam != renderCamera) // not a light
1093211001 if (cam != lightCamera)
1093311002 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10934
- LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
11003
+ LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
1093511004
1093611005 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
1093711006
....@@ -11017,13 +11086,43 @@
1101711086 gl.glOrtho(-skyscale / ratio, skyscale / ratio, -skyscale, skyscale, 0.001, 1000);
1101811087 }
1101911088
11020
- if (newenvy > -1)
11089
+// if (newenvy > -1)
11090
+// {
11091
+// LoadEnvy(newenvy);
11092
+// }
11093
+//
11094
+// newenvy = -1;
11095
+
11096
+ if (transformMode) // object.skyboxname != null && object.skyboxname.equals("cubemaps/default-skyboxes/rgb"))
1102111097 {
11022
- LoadEnvy(newenvy);
11098
+ if (cubemaprgb == null)
11099
+ {
11100
+ cubemaprgb = LoadSkybox("cubemaps/default-skyboxes/rgb2" + "/", "jpg", false);
11101
+ }
11102
+
11103
+ cubemap = cubemaprgb;
1102311104 }
11024
-
11025
- newenvy = -1;
11026
-
11105
+ else
11106
+ {
11107
+ if (object.skyboxname != null)
11108
+ {
11109
+ if (!object.skyboxname.equals(this.loadedskyboxname))
11110
+ {
11111
+ if (cubemap != null && cubemap != cubemaprgb)
11112
+ cubemap.dispose();
11113
+ cubemapcustom = LoadSkybox(object.skyboxname + "/", object.skyboxext, false);
11114
+ loadedskyboxname = object.skyboxname;
11115
+ }
11116
+ }
11117
+ else
11118
+ {
11119
+ cubemapcustom = null;
11120
+ loadedskyboxname = null;
11121
+ }
11122
+
11123
+ cubemap = cubemapcustom;
11124
+ }
11125
+
1102711126 ratio = ((double) getWidth()) / getHeight();
1102811127 //System.out.println("ratio = " + ratio);
1102911128
....@@ -11039,7 +11138,7 @@
1103911138
1104011139 if (!IsFrozen() && !ambientOcclusion)
1104111140 {
11042
- DrawSkyBox(gl);
11141
+ DrawSkyBox(gl, (float)ratio);
1104311142 }
1104411143
1104511144 //if (selection_view == -1)
....@@ -11325,7 +11424,7 @@
1132511424
1132611425 // if (cam != lightCamera)
1132711426 //for (int count = parentcam.GetTransformCount(); --count>=0;)
11328
- LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013
11427
+ LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013
1132911428 }
1133011429
1133111430 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -12399,50 +12498,74 @@
1239912498
1240012499 //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0);
1240112500
12402
- String program =
12501
+ String programmin =
1240312502 // Min shader
1240412503 "!!ARBfp1.0\n" +
12405
- "PARAM zero123 = { 0.0, 1.0, 2.0, 3.0 };" +
12504
+ "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" +
1240612505 "PARAM pow2 = { 0.5, 0.25, 0.125, 0.0 };" +
1240712506 "PARAM one = { 1.0, 1.0, 1.0, 1.0 };" +
1240812507 "PARAM eps = { 0.001, 0.001, 0.001, 1.0 };" +
1240912508 "PARAM infinity = { 100000000, 100000000, 100000000, 1.0 };" +
12509
+ "PARAM light2cam0 = program.env[10];" +
12510
+ "PARAM light2cam1 = program.env[11];" +
12511
+ "PARAM light2cam2 = program.env[12];" +
1241012512 "TEMP temp;" +
1241112513 "TEMP light;" +
1241212514 "TEMP ndotl;" +
1241312515 "TEMP normal;" +
1241412516 "TEMP depth;" +
12517
+ "TEMP eye;" +
12518
+ "TEMP pos;" +
1241512519
1241612520 "MAD normal, fragment.color, zero123.z, -zero123.y;" +
12417
-
12521
+ Normalize("normal") +
1241812522 "MOV light, state.light[0].position;" +
1241912523 "DP3 ndotl.x, light, normal;" +
1242012524
1242112525 // shadow
12422
- "MOV temp, fragment.texcoord[1];" +
12423
- TextureFetch("depth", "temp", "1") +
12526
+ "MOV pos, fragment.texcoord[1];" +
12527
+ "MOV temp, pos;" +
12528
+ ShadowTextureFetch("depth", "temp", "1") +
1242412529 //"TEX depth, fragment.texcoord[1], texture[1], 2D;" +
12425
- "SLT temp.x, fragment.texcoord[1].z, depth.z;" +
12426
-
12530
+ "SLT ndotl.z, fragment.texcoord[1].z, depth.z;" +
1242712531
1242812532 // No shadow when out of frustum
1242912533 //"SGE temp.y, depth.z, zero123.y;" +
1243012534 //"LRP temp.x, temp.y, zero123.y, temp.x;" +
1243112535
12432
- "MUL ndotl.x, ndotl.x, temp.x;" +
12433
- "MAX ndotl.x, ndotl.x, pow2.y;" +
12536
+ "MUL ndotl.x, ndotl.x, ndotl.z;" + // Shadow
1243412537
12538
+ // Backlit
12539
+ "MOV pos.w, zero123.y;" +
12540
+ "DP4 eye.x, pos, light2cam0;" +
12541
+ "DP4 eye.y, pos, light2cam1;" +
12542
+ "DP4 eye.z, pos, light2cam2;" +
12543
+ Normalize("eye") +
12544
+
12545
+ "DP3 ndotl.y, -eye, normal;" +
12546
+ //"MUL ndotl.y, ndotl.y, pow2.x;" +
12547
+ "POW ndotl.y, ndotl.y, pow2.z;" + // backlit
12548
+ "SUB ndotl.y, zero123.y, ndotl.y;" +
12549
+ //"SUB ndotl.y, zero123.y, ndotl.y;" +
12550
+ //"MUL ndotl.y, ndotl.y, pow2.z;" +
12551
+
12552
+ //"MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient
12553
+ //"MAX ndotl.x, ndotl.x, pow2.y;" + // Ambient
12554
+
12555
+ // Pigment
1243512556 "TEX temp, fragment.texcoord[0], texture[0], 2D;" +
12557
+ "LRP temp, zero123.w, temp, one;" + // texture proportion
1243612558 "MUL temp, temp, ndotl.x;" +
1243712559
1243812560 "MUL temp, temp, zero123.z;" +
1243912561
12440
- "MOV temp.w, zero123.y;" + // reset alpha
12562
+ //"MUL temp, temp, ndotl.y;" +
1244112563
12564
+ "MOV temp.w, zero123.y;" + // reset alpha
1244212565 "MOV result.color, temp;" +
1244312566 "END";
1244412567
12445
- String program2 =
12568
+ String programmax =
1244612569 "!!ARBfp1.0\n" +
1244712570
1244812571 //"OPTION ARB_fragment_program_shadow;" +
....@@ -12580,20 +12703,20 @@
1258012703 "MUL temp, floor, mapgrid.x;" +
1258112704 //"TEX depth0, temp, texture[1], 2D;" +
1258212705 (((mode & FP_SOFTSHADOW) == 0) ? "" :
12583
- TextureFetch("depth0", "temp", "1") +
12706
+ ShadowTextureFetch("depth0", "temp", "1") +
1258412707 "") +
1258512708 "ADD temp.x, temp.x, mapgrid.x;" +
1258612709 //"TEX depth1, temp, texture[1], 2D;" +
1258712710 (((mode & FP_SOFTSHADOW) == 0) ? "" :
12588
- TextureFetch("depth1", "temp", "1") +
12711
+ ShadowTextureFetch("depth1", "temp", "1") +
1258912712 "") +
1259012713 "ADD temp.y, temp.y, mapgrid.x;" +
1259112714 //"TEX depth2, temp, texture[1], 2D;" +
12592
- TextureFetch("depth2", "temp", "1") +
12715
+ ShadowTextureFetch("depth2", "temp", "1") +
1259312716 "SUB temp.x, temp.x, mapgrid.x;" +
1259412717 //"TEX depth3, temp, texture[1], 2D;" +
1259512718 (((mode & FP_SOFTSHADOW) == 0) ? "" :
12596
- TextureFetch("depth3", "temp", "1") +
12719
+ ShadowTextureFetch("depth3", "temp", "1") +
1259712720 "") +
1259812721 //"MUL texSamp0, texSamp0, state.material.front.diffuse;" +
1259912722 //"MOV params, material;" +
....@@ -12967,7 +13090,7 @@
1296713090 // display shadow only (fakedepth == 0)
1296813091 "SUB temp.x, half.x, shadow.x;" +
1296913092 "MOV temp.y, -params5.z;" + // params6.x;" +
12970
- "SLT temp.z, temp.y, -one2048th.x;" +
13093
+ "SLT temp.z, temp.y, -c256i.x;" +
1297113094 "SUB temp.y, one.x, temp.z;" +
1297213095 "MUL temp.x, temp.x, temp.y;" +
1297313096 "KIL temp.x;" +
....@@ -13298,8 +13421,19 @@
1329813421 //once = true;
1329913422 }
1330013423
13301
- System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
13302
- System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
13424
+ String program = programmax;
13425
+
13426
+ if (Globals.MINSHADER)
13427
+ {
13428
+ program = programmin;
13429
+ }
13430
+
13431
+ if (Globals.DEBUG)
13432
+ {
13433
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
13434
+ System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
13435
+ }
13436
+
1330313437 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1330413438
1330513439 //gl.glNewList(displayListID, GL.GL_COMPILE);
....@@ -13346,7 +13480,8 @@
1334613480 "\n" +
1334713481 "END\n";
1334813482
13349
- System.out.println("Program shadow #" + 0 + "; length = " + program.length());
13483
+ if (Globals.DEBUG)
13484
+ System.out.println("Program shadow #" + 0 + "; length = " + program.length());
1335013485 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1335113486
1335213487 //gl.glNewList(displayListID, GL.GL_COMPILE);
....@@ -13391,25 +13526,26 @@
1339113526 return out;
1339213527 }
1339313528
13394
- String TextureFetch(String dest, String src, String unit)
13529
+ // Also does frustum culling
13530
+ String ShadowTextureFetch(String dest, String src, String unit)
1339513531 {
1339613532 return "TEX " + dest + ", " + src + ", texture[" + unit + "], 2D;" +
1339713533 "SGE " + src + ".w, " + src + ".x, eps.x;" +
1339813534 "SGE " + src + ".z, " + src + ".y, eps.x;" +
13535
+ "SLT " + dest + ".x, " + src + ".x, one.x;" +
13536
+ "SLT " + dest + ".y, " + src + ".y, one.x;" +
1339913537 "MUL " + src + ".w, " + src + ".z, " + src + ".w;" +
13400
- "SLT " + src + ".z, " + src + ".x, one.x;" +
13401
- "MUL " + src + ".w, " + src + ".z, " + src + ".w;" +
13402
- "SLT " + src + ".z, " + src + ".y, one.x;" +
13403
- "MUL " + src + ".w, " + src + ".z, " + src + ".w;" +
13538
+ "MUL " + src + ".w, " + dest + ".x, " + src + ".w;" +
13539
+ "MUL " + src + ".w, " + dest + ".y, " + src + ".w;" +
1340413540 //"SWZ buffer, temp, w,w,w,w;";
13405
- "MUL " + dest + ".z, " + dest + ".z, " + src + ".w;" +
13541
+ //"MUL " + dest + ".z, " + dest + ".z, " + src + ".w;" +
1340613542 "SUB " + src + ".z, " + "one.x, " + src + ".w;" +
1340713543 //"MUL " + src + ".z, " + src + ".z, infinity.x;" +
1340813544 //"ADD " + dest + ".z, " + dest + ".z, " + src + ".z;";
13409
- "MAD " + dest + ".z, " + src + ".z, infinity.x," + dest + ".z;";
13545
+ //"MAD " + dest + ".z, " + src + ".z, infinity.x," + dest + ".z;";
1341013546
13411
- //"LRP " + dest + ".z, " + src + ".w," + dest + ".z, infinity.x;";
13412
- //"LRP " + dest + ".z" + ", " + src + ".w, infinity.x," + dest + ".z;";
13547
+ //?? "LRP " + dest + ".z, " + src + ".w," + dest + ".z, infinity.x;";
13548
+ "LRP " + dest + ".z, " + src + ".z, infinity.x," + dest + ".z;";
1341313549 }
1341413550
1341513551 String Shadow(String depth, String shadow)
....@@ -14254,14 +14390,15 @@
1425414390 drag = false;
1425514391 //System.out.println("Mouse DOWN");
1425614392 editObj = false;
14257
- ClickInfo info = new ClickInfo();
14258
- info.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14259
- info.pane = this;
14260
- info.camera = renderCamera;
14261
- info.x = x;
14262
- info.y = y;
14263
- info.modifiers = modifiersex;
14264
- editObj = object.doEditClick(info, 0);
14393
+ //ClickInfo info = new ClickInfo();
14394
+ object.clickInfo.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14395
+ object.clickInfo.pane = this;
14396
+ object.clickInfo.camera = renderCamera;
14397
+ object.clickInfo.x = x;
14398
+ object.clickInfo.y = y;
14399
+ object.clickInfo.modifiers = modifiersex;
14400
+ editObj = object.doEditClick(//info,
14401
+ 0);
1426514402 if (!editObj)
1426614403 {
1426714404 hasMarquee = true;
....@@ -14543,11 +14680,17 @@
1454314680 void GoDown(int mod)
1454414681 {
1454514682 MODIFIERS |= COMMAND;
14683
+ boolean isVR = (mouseMode&VR)!=0;
1454614684 /**/
1454714685 if((mod&SHIFT) == SHIFT)
14548
- manipCamera.RotatePosition(0, -speed);
14686
+ {
14687
+ if (isVR)
14688
+ manipCamera.RotateInterest(0, -speed);
14689
+ else
14690
+ manipCamera.RotatePosition(0, -speed);
14691
+ }
1454914692 else
14550
- manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14693
+ manipCamera.BackForth(0, -speed*delta, isVR?1000:0); // getWidth());
1455114694 /**/
1455214695 if ((mod & SHIFT) == SHIFT)
1455314696 {
....@@ -14557,6 +14700,8 @@
1455714700 mouseMode |= BACKFORTH;
1455814701 }
1455914702
14703
+ targetLookAt.set(manipCamera.lookAt);
14704
+
1456014705 //prevX = X = anchorX;
1456114706 prevY = Y = anchorY - (int) (renderCamera.Distance());
1456214707 }
....@@ -14565,10 +14710,17 @@
1456514710 {
1456614711 MODIFIERS |= COMMAND;
1456714712 /**/
14713
+ boolean isVR = (mouseMode&VR)!=0;
14714
+
1456814715 if((mod&SHIFT) == SHIFT)
14569
- manipCamera.RotatePosition(0, speed);
14716
+ {
14717
+ if (isVR)
14718
+ manipCamera.RotateInterest(0, speed);
14719
+ else
14720
+ manipCamera.RotatePosition(0, speed);
14721
+ }
1457014722 else
14571
- manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14723
+ manipCamera.BackForth(0, speed*delta, isVR?1000:0); // getWidth());
1457214724 /**/
1457314725 if ((mod & SHIFT) == SHIFT)
1457414726 {
....@@ -14578,6 +14730,8 @@
1457814730 mouseMode |= BACKFORTH;
1457914731 }
1458014732
14733
+ targetLookAt.set(manipCamera.lookAt);
14734
+
1458114735 //prevX = X = anchorX;
1458214736 prevY = Y = anchorY + (int) (renderCamera.Distance());
1458314737 }
....@@ -14587,9 +14741,14 @@
1458714741 MODIFIERS |= COMMAND;
1458814742 /**/
1458914743 if((mod&SHIFT) == SHIFT)
14590
- manipCamera.Translate(speed*delta, 0, getWidth());
14744
+ manipCamera.Translate(speed*delta, 0, getWidth());
1459114745 else
14592
- manipCamera.RotatePosition(speed, 0);
14746
+ {
14747
+ if ((mouseMode&VR)!=0)
14748
+ manipCamera.RotateInterest(-speed, 0);
14749
+ else
14750
+ manipCamera.RotatePosition(speed, 0);
14751
+ }
1459314752 /**/
1459414753 if ((mod & SHIFT) == SHIFT)
1459514754 {
....@@ -14599,6 +14758,8 @@
1459914758 mouseMode |= ROTATE;
1460014759 } // TRANSLATE;
1460114760
14761
+ targetLookAt.set(manipCamera.lookAt);
14762
+
1460214763 prevX = X = anchorX - 10; // (int)(10*renderCamera.Distance());
1460314764 prevY = Y = anchorY;
1460414765 }
....@@ -14608,9 +14769,15 @@
1460814769 MODIFIERS |= COMMAND;
1460914770 /**/
1461014771 if((mod&SHIFT) == SHIFT)
14611
- manipCamera.Translate(-speed*delta, 0, getWidth());
14772
+ manipCamera.Translate(-speed*delta, 0, getWidth());
1461214773 else
14613
- manipCamera.RotatePosition(-speed, 0);
14774
+ {
14775
+ if ((mouseMode&VR)!=0)
14776
+ manipCamera.RotateInterest(speed, 0);
14777
+ else
14778
+ manipCamera.RotatePosition(-speed, 0);
14779
+ }
14780
+
1461414781 /**/
1461514782 if ((mod & SHIFT) == SHIFT)
1461614783 {
....@@ -14620,6 +14787,8 @@
1462014787 mouseMode |= ROTATE;
1462114788 } // TRANSLATE;
1462214789
14790
+ targetLookAt.set(manipCamera.lookAt);
14791
+
1462314792 prevX = X = anchorX + 10; // (int)(10*renderCamera.Distance());
1462414793 prevY = Y = anchorY;
1462514794 }
....@@ -14661,15 +14830,16 @@
1466114830 if (editObj)
1466214831 {
1466314832 drag = true;
14664
- ClickInfo info = new ClickInfo();
14665
- info.bounds.setBounds(0, 0,
14833
+ //ClickInfo info = new ClickInfo();
14834
+ object.clickInfo.bounds.setBounds(0, 0,
1466614835 (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14667
- info.pane = this;
14668
- info.camera = renderCamera;
14669
- info.x = x;
14670
- info.y = y;
14671
- object.GetWindow().copy
14672
- .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
14836
+ object.clickInfo.pane = this;
14837
+ object.clickInfo.camera = renderCamera;
14838
+ object.clickInfo.x = x;
14839
+ object.clickInfo.y = y;
14840
+ object //.GetWindow().copy
14841
+ .doEditDrag(//info,
14842
+ (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1467314843 } else
1467414844 {
1467514845 if (x < startX)
....@@ -14818,24 +14988,27 @@
1481814988 }
1481914989 }
1482014990
14991
+// ClickInfo clickInfo = new ClickInfo();
14992
+
1482114993 public void mouseMoved(MouseEvent e)
1482214994 {
1482314995 //System.out.println("mouseMoved: " + e);
1482414996 if (isRenderer)
1482514997 return;
1482614998
14827
- ClickInfo ci = new ClickInfo();
14828
- ci.x = e.getX();
14829
- ci.y = e.getY();
14830
- ci.modifiers = e.getModifiersEx();
14831
- ci.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14832
- ci.pane = this;
14833
- ci.camera = renderCamera;
14999
+ // Mouse cursor feedback
15000
+ object.clickInfo.x = e.getX();
15001
+ object.clickInfo.y = e.getY();
15002
+ object.clickInfo.modifiers = e.getModifiersEx();
15003
+ object.clickInfo.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
15004
+ object.clickInfo.pane = this;
15005
+ object.clickInfo.camera = renderCamera;
1483415006 if (!isRenderer)
1483515007 {
1483615008 //ObjEditor editWindow = object.editWindow;
1483715009 //Object3D copy = editWindow.copy;
14838
- if (object.doEditClick(ci, 0))
15010
+ if (object.doEditClick(//clickInfo,
15011
+ 0))
1483915012 {
1484015013 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
1484115014 } else
....@@ -15118,8 +15291,8 @@
1511815291 case 'K':
1511915292 KOMPACTTEXTURE ^= true;
1512015293 //textures.clear();
15121
- break;
15122
- case 'P': // Texture Projection macros
15294
+ // break;
15295
+ //case 'P': // Texture Projection macros
1512315296 // SAVETEXTURE ^= true;
1512415297 macromode = true;
1512515298 Udebug = Vdebug = NORMALdebug = false; programInitialized = false;
....@@ -15240,7 +15413,7 @@
1524015413 targetLookAt.set(manipCamera.lookAt);
1524115414 repaint();
1524215415 break;
15243
- case 'p':
15416
+ case 'P': // p':
1524415417 // c'est quoi ca au juste? spherical ^= true;
1524515418 Skinshader ^= true; programInitialized = false;
1524615419 repaint();
....@@ -15285,20 +15458,24 @@
1528515458 OCCLUSION_CULLING ^= true;
1528615459 System.out.println("OCCLUSION CULLING = " + OCCLUSION_CULLING);
1528715460 break;
15288
- case '0': envyoff ^= true; repaint(); break;
15461
+ //case '0': envyoff ^= true; repaint(); break;
1528915462 case '1':
1529015463 case '2':
1529115464 case '3':
1529215465 case '4':
1529315466 case '5':
15294
- newenvy = Character.getNumericValue(key);
15295
- repaint();
15296
- break;
1529715467 case '6':
1529815468 case '7':
1529915469 case '8':
1530015470 case '9':
15301
- BGcolor = (key - '6')/3.f;
15471
+ if (true) // envyoff)
15472
+ {
15473
+ BGcolor = (key - '1')/8.f;
15474
+ }
15475
+ else
15476
+ {
15477
+ //newenvy = Character.getNumericValue(key);
15478
+ }
1530215479 repaint();
1530315480 break;
1530415481 case '!':
....@@ -15861,8 +16038,6 @@
1586116038
1586216039 int width = getBounds().width;
1586316040 int height = getBounds().height;
15864
- ClickInfo info = new ClickInfo();
15865
- info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
1586616041 //Image img = CreateImage(width, height);
1586716042 //System.out.println("width = " + width + "; height = " + height + "\n");
1586816043
....@@ -15939,31 +16114,37 @@
1593916114 }
1594016115 if (object != null && !hasMarquee)
1594116116 {
16117
+ if (object.clickInfo == null)
16118
+ object.clickInfo = new ClickInfo();
16119
+ ClickInfo info = object.clickInfo;
16120
+ //ClickInfo info = new ClickInfo();
16121
+ info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
16122
+
1594216123 if (isRenderer)
1594316124 {
15944
- info.flags++;
16125
+ object.clickInfo.flags++;
1594516126 double frameAspect = (double) width / (double) height;
1594616127 if (frameAspect > renderCamera.aspect)
1594716128 {
1594816129 int desired = (int) ((double) height * renderCamera.aspect);
15949
- info.bounds.width -= width - desired;
15950
- info.bounds.x += (width - desired) / 2;
16130
+ object.clickInfo.bounds.width -= width - desired;
16131
+ object.clickInfo.bounds.x += (width - desired) / 2;
1595116132 } else
1595216133 {
1595316134 int desired = (int) ((double) width / renderCamera.aspect);
15954
- info.bounds.height -= height - desired;
15955
- info.bounds.y += (height - desired) / 2;
16135
+ object.clickInfo.bounds.height -= height - desired;
16136
+ object.clickInfo.bounds.y += (height - desired) / 2;
1595616137 }
1595716138 }
1595816139
15959
- info.g = gr;
15960
- info.camera = renderCamera;
16140
+ object.clickInfo.g = gr;
16141
+ object.clickInfo.camera = renderCamera;
1596116142 /*
1596216143 // Memory intensive (brep.verticescopy)
1596316144 if (!(object instanceof Composite))
1596416145 object.draw(info, 0, false); // SLOW :
1596516146 */
15966
- if (!isRenderer)
16147
+ if (!isRenderer) // && drag)
1596716148 {
1596816149 Grafreed.Assert(object != null);
1596916150 Grafreed.Assert(object.selection != null);
....@@ -15971,9 +16152,9 @@
1597116152 {
1597216153 int hitSomething = object.selection.get(0).hitSomething;
1597316154
15974
- info.DX = 0;
15975
- info.DY = 0;
15976
- info.W = 1;
16155
+ object.clickInfo.DX = 0;
16156
+ object.clickInfo.DY = 0;
16157
+ object.clickInfo.W = 1;
1597716158 if (hitSomething == Object3D.hitCenter)
1597816159 {
1597916160 info.DX = X;
....@@ -15985,13 +16166,14 @@
1598516166 info.DY -= info.bounds.height/2;
1598616167 }
1598716168
15988
- object.drawEditHandles(info, 0);
16169
+ object.drawEditHandles(//info,
16170
+ 0);
1598916171
1599016172 if (drag && (X != 0 || Y != 0))
1599116173 {
1599216174 switch (hitSomething)
1599316175 {
15994
- case Object3D.hitCenter: gr.setColor(Color.pink);
16176
+ case Object3D.hitCenter: gr.setColor(Color.white);
1599516177 gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1599616178 break;
1599716179 case Object3D.hitRotate: gr.setColor(Color.yellow);
....@@ -16017,7 +16199,7 @@
1601716199 if (hasMarquee)
1601816200 {
1601916201 gr.setXORMode(Color.white);
16020
- gr.setColor(Color.red);
16202
+ gr.setColor(Color.white);
1602116203 if (!firstime)
1602216204 {
1602316205 gr.drawRect(prevmarqX, prevmarqY, prevmarqW, prevmarqH);
....@@ -16484,6 +16666,8 @@
1648416666 private /*static*/ boolean firstime;
1648516667 private /*static*/ cVector newView = new cVector();
1648616668 private static final String[] suffixes = {"posx", "negx", "posy", "negy", "posz", "negz"};
16669
+ private static final String[] suffixes2 = {"east", "west", "top", "bottom", "north", "south"};
16670
+ private static final String[] suffixes3 = {"ft", "bk", "up", "dn", "rt", "lf"};
1648716671 private static final int[] targets = {GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
1648816672 GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
1648916673 GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
....@@ -16496,29 +16680,67 @@
1649616680 {
1649716681 com.sun.opengl.util.texture.Texture cubemap = TextureIO.newTexture(GL.GL_TEXTURE_CUBE_MAP);
1649816682
16683
+ int usedsuf = 0;
16684
+
1649916685 for (int i = 0; i < suffixes.length; i++)
1650016686 {
16501
- String resourceName = basename + suffixes[i] + "." + suffix;
16502
- TextureData data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16503
- mipmapped,
16504
- FileUtil.getFileSuffix(resourceName));
16505
- if (data == null)
16687
+ String[] suffixe = suffixes;
16688
+ String[] fallback = suffixes2;
16689
+ String[] fallfallback = suffixes3;
16690
+
16691
+ for (int c=usedsuf; --c>=0;)
1650616692 {
16507
- throw new IOException("Unable to load texture " + resourceName);
16693
+// String[] temp = suffixe;
16694
+// suffixe = fallback;
16695
+// fallback = fallfallback;
16696
+// fallfallback = temp;
1650816697 }
16698
+
16699
+ String resourceName = basename + suffixe[i] + "." + suffix;
16700
+ TextureData data;
16701
+
16702
+ try
16703
+ {
16704
+ data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16705
+ mipmapped,
16706
+ FileUtil.getFileSuffix(resourceName));
16707
+ }
16708
+ catch (Exception e)
16709
+ {
16710
+ try
16711
+ {
16712
+ resourceName = basename + fallback[i] + "." + suffix;
16713
+ data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16714
+ mipmapped,
16715
+ FileUtil.getFileSuffix(resourceName));
16716
+ }
16717
+ catch (Exception e2)
16718
+ {
16719
+ resourceName = basename + fallfallback[i] + "." + suffix;
16720
+ data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName),
16721
+ mipmapped,
16722
+ FileUtil.getFileSuffix(resourceName));
16723
+ }
16724
+ }
16725
+
1650916726 //System.out.println("Target = " + targets[i]);
1651016727 cubemap.updateImage(data, targets[i]);
1651116728 }
1651216729
1651316730 return cubemap;
1651416731 }
16732
+
1651516733 int bigsphere = -1;
1651616734
1651716735 float BGcolor = 0.5f;
1651816736
16519
- private void DrawSkyBox(GL gl)
16737
+ float ambientLight[] = {1f, 1f, 1f, 1.0f};
16738
+
16739
+ private void DrawSkyBox(GL gl, float ratio)
1652016740 {
16521
- if (envyoff || cubemap == null)
16741
+ if (//envyoff ||
16742
+ WIREFRAME ||
16743
+ cubemap == null)
1652216744 {
1652316745 gl.glClearColor(BGcolor, BGcolor, BGcolor, 1);
1652416746 gl.glClear(gl.GL_COLOR_BUFFER_BIT);
....@@ -16533,7 +16755,17 @@
1653316755 // Compensates for ExaminerViewer's modification of modelview matrix
1653416756 gl.glMatrixMode(GL.GL_MODELVIEW);
1653516757 gl.glLoadIdentity();
16758
+ gl.glScalef(1,ratio,1);
1653616759
16760
+// colorV[0] = 2;
16761
+// colorV[1] = 2;
16762
+// colorV[2] = 2;
16763
+// colorV[3] = 1;
16764
+// gl.glDisable(gl.GL_COLOR_MATERIAL);
16765
+// gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0);
16766
+//
16767
+// gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0);
16768
+
1653716769 //gl.glActiveTexture(GL.GL_TEXTURE1);
1653816770 //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP);
1653916771
....@@ -16565,6 +16797,7 @@
1656516797 {
1656616798 gl.glScalef(1.0f, -1.0f, 1.0f);
1656716799 }
16800
+ gl.glScalef(-1.0f, 1.0f, 1.0f);
1656816801 gl.glMultMatrixd(viewrot_1, 0);
1656916802 gl.glTranslatef(0, 0, 0.5f); // (float)lightCamera.Distance()); // 0.5f);
1657016803 //viewer.updateInverseRotation(gl);
....@@ -16605,7 +16838,8 @@
1660516838 gl.glDisable(GL.GL_TEXTURE_GEN_R);
1660616839
1660716840 cubemap.disable();
16608
- ////cubemap.unbind();
16841
+ //cubemap.dispose();
16842
+
1660916843 if (CULLFACE)
1661016844 {
1661116845 gl.glEnable(gl.GL_CULL_FACE);
....@@ -16823,7 +17057,7 @@
1682317057 //new Exception().printStackTrace();
1682417058 System.out.println("select buffer init");
1682517059 // Use debug pipeline
16826
- drawable.setGL(new DebugGL(drawable.getGL()));
17060
+ //drawable.setGL(new DebugGL(drawable.getGL()));
1682717061
1682817062 GL gl = drawable.getGL();
1682917063
....@@ -17141,6 +17375,7 @@
1714117375
1714217376 public void init(GLAutoDrawable drawable)
1714317377 {
17378
+ if (Globals.DEBUG)
1714417379 System.out.println("shadow buffer init");
1714517380
1714617381 GL gl = drawable.getGL();
....@@ -17369,10 +17604,14 @@
1736917604 gl.glFlush();
1737017605
1737117606 /**/
17372
- gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusionsizebuffer);
17607
+ gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusiondepthbuffer);
1737317608
17374
- float[] pixels = occlusionsizebuffer.array();
17609
+ float[] depths = occlusiondepthbuffer.array();
1737517610
17611
+ gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_BGRA, GL.GL_UNSIGNED_INT_8_8_8_8_REV, occlusioncolorbuffer);
17612
+
17613
+ int[] pixels = selectsizebuffer.array();
17614
+
1737617615 double r = 0, g = 0, b = 0;
1737717616
1737817617 double count = 0;
....@@ -17383,7 +17622,7 @@
1738317622
1738417623 double FACTOR = 1;
1738517624
17386
- for (int i = 0; i < pixels.length; i++)
17625
+ for (int i = 0; i < depths.length; i++)
1738717626 {
1738817627 int x = i / OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
1738917628 int y = i % OCCLUSION_SIZE - OCCLUSION_SIZE / 2;
....@@ -17466,7 +17705,7 @@
1746617705
1746717706 double scale = ray.z; // 1; // cos
1746817707
17469
- float depth = pixels[newindex];
17708
+ float depth = depths[newindex];
1747017709
1747117710 /*
1747217711 int newindex2 = (x + 1) * OCCLUSION_SIZE + y;
....@@ -17663,11 +17902,14 @@
1766317902 static IntBuffer AAbuffer; // = IntBuffer.allocate(MAX_SIZE*MAX_SIZE);
1766417903 static IntBuffer bigAAbuffer;
1766517904 static java.nio.FloatBuffer histogram = BufferUtil.newFloatBuffer(HISTOGRAM_SIZE * 3);
17666
- static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);
17905
+ //static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE);
1766717906 static IntBuffer selectsizebuffer = IntBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1766817907 static java.nio.FloatBuffer pointselectsizebuffer = java.nio.FloatBuffer.allocate(SELECT_SIZE * SELECT_SIZE);
1766917908 //static IntBuffer occlusionsizebuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17670
- static java.nio.FloatBuffer occlusionsizebuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17909
+ static java.nio.FloatBuffer occlusiondepthbuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17910
+
17911
+ static IntBuffer occlusioncolorbuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE);
17912
+
1767117913 static BufferedImage bufimage = new BufferedImage(TEX_SIZE, TEX_SIZE, BufferedImage.TYPE_INT_RGB);
1767217914 static BufferedImage textest = new cBufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
1767317915 static java.util.Vector<BufferedImage> billboards = new java.util.Vector<BufferedImage>();