.. | .. |
---|
8358 | 8358 | // else |
---|
8359 | 8359 | // if (!texname.startsWith("/")) |
---|
8360 | 8360 | // texname = "/Users/nbriere/Textures/" + texname; |
---|
8361 | | - if (!FileExists(texname)) |
---|
| 8361 | + if (!FileExists(texname) && !texname.startsWith("@")) |
---|
8362 | 8362 | { |
---|
8363 | 8363 | texname = fallbackTextureName; |
---|
8364 | 8364 | } |
---|
.. | .. |
---|
8441 | 8441 | new Exception().printStackTrace(); |
---|
8442 | 8442 | } else |
---|
8443 | 8443 | { |
---|
| 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 | + { |
---|
8444 | 8453 | if (textureon) |
---|
8445 | 8454 | { |
---|
8446 | 8455 | String cachename = texname; |
---|
.. | .. |
---|
8500 | 8509 | texturecache = new CacheTexture(texturedata,resolution); |
---|
8501 | 8510 | //texture = GetTexture(tex, bump); |
---|
8502 | 8511 | } |
---|
| 8512 | + } |
---|
8503 | 8513 | } |
---|
8504 | 8514 | //} |
---|
8505 | 8515 | } |
---|
.. | .. |
---|
10841 | 10851 | |
---|
10842 | 10852 | if (wait) |
---|
10843 | 10853 | { |
---|
10844 | | - Sleep(500); |
---|
| 10854 | + Sleep(200); // blocks everything |
---|
10845 | 10855 | |
---|
10846 | 10856 | wait = false; |
---|
10847 | 10857 | } |
---|
.. | .. |
---|
11379 | 11389 | |
---|
11380 | 11390 | // if (cam != lightCamera) |
---|
11381 | 11391 | //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 |
---|
11383 | 11393 | } |
---|
11384 | 11394 | |
---|
11385 | 11395 | LA.xformDir(lightposition, cam.toScreen, lightposition); |
---|
.. | .. |
---|
12453 | 12463 | |
---|
12454 | 12464 | //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0); |
---|
12455 | 12465 | |
---|
12456 | | - String program0 = |
---|
| 12466 | + String programmin = |
---|
12457 | 12467 | // Min shader |
---|
12458 | 12468 | "!!ARBfp1.0\n" + |
---|
12459 | 12469 | "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" + |
---|
.. | .. |
---|
12520 | 12530 | "MOV result.color, temp;" + |
---|
12521 | 12531 | "END"; |
---|
12522 | 12532 | |
---|
12523 | | - String program = |
---|
| 12533 | + String programmax = |
---|
12524 | 12534 | "!!ARBfp1.0\n" + |
---|
12525 | 12535 | |
---|
12526 | 12536 | //"OPTION ARB_fragment_program_shadow;" + |
---|
.. | .. |
---|
13376 | 13386 | //once = true; |
---|
13377 | 13387 | } |
---|
13378 | 13388 | |
---|
| 13389 | + String program = programmax; |
---|
| 13390 | + |
---|
| 13391 | + if (Globals.MINSHADER) |
---|
| 13392 | + { |
---|
| 13393 | + program = programmin; |
---|
| 13394 | + } |
---|
| 13395 | + |
---|
13379 | 13396 | System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
13380 | 13397 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
13381 | 13398 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
.. | .. |
---|
14625 | 14642 | MODIFIERS |= COMMAND; |
---|
14626 | 14643 | /**/ |
---|
14627 | 14644 | if((mod&SHIFT) == SHIFT) |
---|
14628 | | - manipCamera.RotatePosition(0, -speed); |
---|
14629 | | - else |
---|
14630 | 14645 | manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14646 | + else |
---|
| 14647 | + manipCamera.RotatePosition(0, -speed); |
---|
14631 | 14648 | /**/ |
---|
14632 | 14649 | if ((mod & SHIFT) == SHIFT) |
---|
14633 | 14650 | { |
---|
.. | .. |
---|
14646 | 14663 | MODIFIERS |= COMMAND; |
---|
14647 | 14664 | /**/ |
---|
14648 | 14665 | if((mod&SHIFT) == SHIFT) |
---|
14649 | | - manipCamera.RotatePosition(0, speed); |
---|
14650 | | - else |
---|
14651 | 14666 | manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14667 | + else |
---|
| 14668 | + manipCamera.RotatePosition(0, speed); |
---|
14652 | 14669 | /**/ |
---|
14653 | 14670 | if ((mod & SHIFT) == SHIFT) |
---|
14654 | 14671 | { |
---|
.. | .. |
---|
16667 | 16684 | gl.glLoadIdentity(); |
---|
16668 | 16685 | gl.glScalef(1,ratio,1); |
---|
16669 | 16686 | |
---|
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); |
---|
16678 | 16695 | |
---|
16679 | 16696 | //gl.glActiveTexture(GL.GL_TEXTURE1); |
---|
16680 | 16697 | //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP); |
---|
.. | .. |
---|
16688 | 16705 | // GL_NORMAL_MAP texgen mode. Temporarily enabling lighting |
---|
16689 | 16706 | // causes the normals to be sent down. Thanks to Ken Dyke. |
---|
16690 | 16707 | //gl.glEnable(GL.GL_LIGHTING); |
---|
16691 | | - gl.glEnable(GL.GL_LIGHTING); |
---|
| 16708 | + gl.glDisable(GL.GL_LIGHTING); |
---|
16692 | 16709 | |
---|
16693 | 16710 | gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP); |
---|
16694 | 16711 | gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP); |
---|