Normand Briere
2019-08-09 912749d2520afedd9b56458d771400c261fe2b88
CameraPane.java
....@@ -8358,7 +8358,7 @@
83588358 // else
83598359 // if (!texname.startsWith("/"))
83608360 // texname = "/Users/nbriere/Textures/" + texname;
8361
- if (!FileExists(texname))
8361
+ if (!FileExists(texname) && !texname.startsWith("@"))
83628362 {
83638363 texname = fallbackTextureName;
83648364 }
....@@ -8441,6 +8441,15 @@
84418441 new Exception().printStackTrace();
84428442 } else
84438443 {
8444
+ if (texname.startsWith("@"))
8445
+ {
8446
+ // texturecache = textures.get(texname); // suspicious
8447
+ if (texturecache == null)
8448
+ texturecache = new CacheTexture(GetResourceTexture(texname.substring(1), bump),resolution);
8449
+ else
8450
+ new Exception().printStackTrace();
8451
+ } else
8452
+ {
84448453 if (textureon)
84458454 {
84468455 String cachename = texname;
....@@ -8500,6 +8509,7 @@
85008509 texturecache = new CacheTexture(texturedata,resolution);
85018510 //texture = GetTexture(tex, bump);
85028511 }
8512
+ }
85038513 }
85048514 //}
85058515 }
....@@ -10841,7 +10851,7 @@
1084110851
1084210852 if (wait)
1084310853 {
10844
- Sleep(500);
10854
+ Sleep(200); // blocks everything
1084510855
1084610856 wait = false;
1084710857 }
....@@ -11379,7 +11389,7 @@
1137911389
1138011390 // if (cam != lightCamera)
1138111391 //for (int count = parentcam.GetTransformCount(); --count>=0;)
11382
- LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013
11392
+ LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013
1138311393 }
1138411394
1138511395 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -12453,7 +12463,7 @@
1245312463
1245412464 //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0);
1245512465
12456
- String program0 =
12466
+ String programmin =
1245712467 // Min shader
1245812468 "!!ARBfp1.0\n" +
1245912469 "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" +
....@@ -12520,7 +12530,7 @@
1252012530 "MOV result.color, temp;" +
1252112531 "END";
1252212532
12523
- String program =
12533
+ String programmax =
1252412534 "!!ARBfp1.0\n" +
1252512535
1252612536 //"OPTION ARB_fragment_program_shadow;" +
....@@ -13376,6 +13386,13 @@
1337613386 //once = true;
1337713387 }
1337813388
13389
+ String program = programmax;
13390
+
13391
+ if (Globals.MINSHADER)
13392
+ {
13393
+ program = programmin;
13394
+ }
13395
+
1337913396 System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1338013397 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1338113398 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
....@@ -14625,9 +14642,9 @@
1462514642 MODIFIERS |= COMMAND;
1462614643 /**/
1462714644 if((mod&SHIFT) == SHIFT)
14628
- manipCamera.RotatePosition(0, -speed);
14629
- else
1463014645 manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14646
+ else
14647
+ manipCamera.RotatePosition(0, -speed);
1463114648 /**/
1463214649 if ((mod & SHIFT) == SHIFT)
1463314650 {
....@@ -14646,9 +14663,9 @@
1464614663 MODIFIERS |= COMMAND;
1464714664 /**/
1464814665 if((mod&SHIFT) == SHIFT)
14649
- manipCamera.RotatePosition(0, speed);
14650
- else
1465114666 manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14667
+ else
14668
+ manipCamera.RotatePosition(0, speed);
1465214669 /**/
1465314670 if ((mod & SHIFT) == SHIFT)
1465414671 {
....@@ -16091,7 +16108,7 @@
1609116108 gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1609216109 break;
1609316110 case Object3D.hitScale: gr.setColor(Color.cyan);
16094
- gr.drawLine(X, Y, 0, 0);
16111
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1609516112 break;
1609616113 }
1609716114
....@@ -16667,14 +16684,14 @@
1666716684 gl.glLoadIdentity();
1666816685 gl.glScalef(1,ratio,1);
1666916686
16670
- colorV[0] = 2;
16671
- colorV[1] = 2;
16672
- colorV[2] = 2;
16673
- colorV[3] = 1;
16674
- gl.glDisable(gl.GL_COLOR_MATERIAL);
16675
- gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0);
16676
-
16677
- gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0);
16687
+// colorV[0] = 2;
16688
+// colorV[1] = 2;
16689
+// colorV[2] = 2;
16690
+// colorV[3] = 1;
16691
+// gl.glDisable(gl.GL_COLOR_MATERIAL);
16692
+// gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0);
16693
+//
16694
+// gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0);
1667816695
1667916696 //gl.glActiveTexture(GL.GL_TEXTURE1);
1668016697 //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP);
....@@ -16688,7 +16705,7 @@
1668816705 // GL_NORMAL_MAP texgen mode. Temporarily enabling lighting
1668916706 // causes the normals to be sent down. Thanks to Ken Dyke.
1669016707 //gl.glEnable(GL.GL_LIGHTING);
16691
- gl.glEnable(GL.GL_LIGHTING);
16708
+ gl.glDisable(GL.GL_LIGHTING);
1669216709
1669316710 gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);
1669416711 gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);