Normand Briere
2019-08-12 8f1afe25ea8fc8801aab66331c32a50859a758c2
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 }
....@@ -8768,10 +8778,12 @@
87688778
87698779 gl.glGetIntegerv(GL.GL_MAX_TEXTURE_STACK_DEPTH, temp, 0);
87708780 MAXSTACK = temp[0];
8771
- System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
8781
+ if (Globals.DEBUG)
8782
+ System.out.println("GL_MAX_TEXTURE_STACK_DEPTH = " + MAXSTACK);
87728783 gl.glGetIntegerv(GL.GL_MAX_MODELVIEW_STACK_DEPTH, temp, 0);
87738784 MAXSTACK = temp[0];
8774
- System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
8785
+ if (Globals.DEBUG)
8786
+ System.out.println("GL_MAX_MODELVIEW_STACK_DEPTH = " + MAXSTACK);
87758787
87768788 // Use debug pipeline
87778789 //drawable.setGL(new DebugGL(gl)); //
....@@ -8779,7 +8791,8 @@
87798791 gl = drawable.getGL(); //
87808792
87818793 GL gl3 = getGL();
8782
- System.out.println("INIT GL IS: " + gl.getClass().getName());
8794
+ if (Globals.DEBUG)
8795
+ System.out.println("INIT GL IS: " + gl.getClass().getName());
87838796
87848797
87858798 //float pos[] = { 100, 100, 100, 0 };
....@@ -10841,7 +10854,7 @@
1084110854
1084210855 if (wait)
1084310856 {
10844
- Sleep(500);
10857
+ Sleep(200); // blocks everything
1084510858
1084610859 wait = false;
1084710860 }
....@@ -11379,7 +11392,7 @@
1137911392
1138011393 // if (cam != lightCamera)
1138111394 //for (int count = parentcam.GetTransformCount(); --count>=0;)
11382
- LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013
11395
+ LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013
1138311396 }
1138411397
1138511398 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -12453,7 +12466,7 @@
1245312466
1245412467 //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0);
1245512468
12456
- String program0 =
12469
+ String programmin =
1245712470 // Min shader
1245812471 "!!ARBfp1.0\n" +
1245912472 "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" +
....@@ -12520,7 +12533,7 @@
1252012533 "MOV result.color, temp;" +
1252112534 "END";
1252212535
12523
- String program =
12536
+ String programmax =
1252412537 "!!ARBfp1.0\n" +
1252512538
1252612539 //"OPTION ARB_fragment_program_shadow;" +
....@@ -13376,6 +13389,13 @@
1337613389 //once = true;
1337713390 }
1337813391
13392
+ String program = programmax;
13393
+
13394
+ if (Globals.MINSHADER)
13395
+ {
13396
+ program = programmin;
13397
+ }
13398
+
1337913399 System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1338013400 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1338113401 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
....@@ -14625,9 +14645,9 @@
1462514645 MODIFIERS |= COMMAND;
1462614646 /**/
1462714647 if((mod&SHIFT) == SHIFT)
14628
- manipCamera.RotatePosition(0, -speed);
14629
- else
1463014648 manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14649
+ else
14650
+ manipCamera.RotatePosition(0, -speed);
1463114651 /**/
1463214652 if ((mod & SHIFT) == SHIFT)
1463314653 {
....@@ -14646,9 +14666,9 @@
1464614666 MODIFIERS |= COMMAND;
1464714667 /**/
1464814668 if((mod&SHIFT) == SHIFT)
14649
- manipCamera.RotatePosition(0, speed);
14650
- else
1465114669 manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14670
+ else
14671
+ manipCamera.RotatePosition(0, speed);
1465214672 /**/
1465314673 if ((mod & SHIFT) == SHIFT)
1465414674 {
....@@ -16091,7 +16111,7 @@
1609116111 gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1609216112 break;
1609316113 case Object3D.hitScale: gr.setColor(Color.cyan);
16094
- gr.drawLine(X, Y, 0, 0);
16114
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1609516115 break;
1609616116 }
1609716117
....@@ -16650,6 +16670,7 @@
1665016670 private void DrawSkyBox(GL gl, float ratio)
1665116671 {
1665216672 if (//envyoff ||
16673
+ WIREFRAME ||
1665316674 cubemap == null)
1665416675 {
1665516676 gl.glClearColor(BGcolor, BGcolor, BGcolor, 1);
....@@ -16667,14 +16688,14 @@
1666716688 gl.glLoadIdentity();
1666816689 gl.glScalef(1,ratio,1);
1666916690
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);
16691
+// colorV[0] = 2;
16692
+// colorV[1] = 2;
16693
+// colorV[2] = 2;
16694
+// colorV[3] = 1;
16695
+// gl.glDisable(gl.GL_COLOR_MATERIAL);
16696
+// gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0);
16697
+//
16698
+// gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0);
1667816699
1667916700 //gl.glActiveTexture(GL.GL_TEXTURE1);
1668016701 //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP);
....@@ -16688,7 +16709,7 @@
1668816709 // GL_NORMAL_MAP texgen mode. Temporarily enabling lighting
1668916710 // causes the normals to be sent down. Thanks to Ken Dyke.
1669016711 //gl.glEnable(GL.GL_LIGHTING);
16691
- gl.glEnable(GL.GL_LIGHTING);
16712
+ gl.glDisable(GL.GL_LIGHTING);
1669216713
1669316714 gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);
1669416715 gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);