.. | .. |
---|
11379 | 11379 | |
---|
11380 | 11380 | // if (cam != lightCamera) |
---|
11381 | 11381 | //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
11382 | | - LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013 |
---|
| 11382 | + LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013 |
---|
11383 | 11383 | } |
---|
11384 | 11384 | |
---|
11385 | 11385 | LA.xformDir(lightposition, cam.toScreen, lightposition); |
---|
.. | .. |
---|
12453 | 12453 | |
---|
12454 | 12454 | //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0); |
---|
12455 | 12455 | |
---|
12456 | | - String program0 = |
---|
| 12456 | + String programmin = |
---|
12457 | 12457 | // Min shader |
---|
12458 | 12458 | "!!ARBfp1.0\n" + |
---|
12459 | 12459 | "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" + |
---|
.. | .. |
---|
12520 | 12520 | "MOV result.color, temp;" + |
---|
12521 | 12521 | "END"; |
---|
12522 | 12522 | |
---|
12523 | | - String program = |
---|
| 12523 | + String programmax = |
---|
12524 | 12524 | "!!ARBfp1.0\n" + |
---|
12525 | 12525 | |
---|
12526 | 12526 | //"OPTION ARB_fragment_program_shadow;" + |
---|
.. | .. |
---|
13376 | 13376 | //once = true; |
---|
13377 | 13377 | } |
---|
13378 | 13378 | |
---|
| 13379 | + String program = programmax; |
---|
| 13380 | + |
---|
| 13381 | + if (Globals.MINSHADER) |
---|
| 13382 | + { |
---|
| 13383 | + program = programmin; |
---|
| 13384 | + } |
---|
| 13385 | + |
---|
13379 | 13386 | System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
13380 | 13387 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
13381 | 13388 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
.. | .. |
---|
14625 | 14632 | MODIFIERS |= COMMAND; |
---|
14626 | 14633 | /**/ |
---|
14627 | 14634 | if((mod&SHIFT) == SHIFT) |
---|
14628 | | - manipCamera.RotatePosition(0, -speed); |
---|
14629 | | - else |
---|
14630 | 14635 | manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14636 | + else |
---|
| 14637 | + manipCamera.RotatePosition(0, -speed); |
---|
14631 | 14638 | /**/ |
---|
14632 | 14639 | if ((mod & SHIFT) == SHIFT) |
---|
14633 | 14640 | { |
---|
.. | .. |
---|
14646 | 14653 | MODIFIERS |= COMMAND; |
---|
14647 | 14654 | /**/ |
---|
14648 | 14655 | if((mod&SHIFT) == SHIFT) |
---|
14649 | | - manipCamera.RotatePosition(0, speed); |
---|
14650 | | - else |
---|
14651 | 14656 | manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14657 | + else |
---|
| 14658 | + manipCamera.RotatePosition(0, speed); |
---|
14652 | 14659 | /**/ |
---|
14653 | 14660 | if ((mod & SHIFT) == SHIFT) |
---|
14654 | 14661 | { |
---|
.. | .. |
---|
16091 | 16098 | gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
16092 | 16099 | break; |
---|
16093 | 16100 | case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
16094 | | - gr.drawLine(X, Y, 0, 0); |
---|
| 16101 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
16095 | 16102 | break; |
---|
16096 | 16103 | } |
---|
16097 | 16104 | |
---|
.. | .. |
---|
16667 | 16674 | gl.glLoadIdentity(); |
---|
16668 | 16675 | gl.glScalef(1,ratio,1); |
---|
16669 | 16676 | |
---|
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); |
---|
| 16677 | +// colorV[0] = 2; |
---|
| 16678 | +// colorV[1] = 2; |
---|
| 16679 | +// colorV[2] = 2; |
---|
| 16680 | +// colorV[3] = 1; |
---|
| 16681 | +// gl.glDisable(gl.GL_COLOR_MATERIAL); |
---|
| 16682 | +// gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0); |
---|
| 16683 | +// |
---|
| 16684 | +// gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0); |
---|
16678 | 16685 | |
---|
16679 | 16686 | //gl.glActiveTexture(GL.GL_TEXTURE1); |
---|
16680 | 16687 | //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP); |
---|
.. | .. |
---|
16688 | 16695 | // GL_NORMAL_MAP texgen mode. Temporarily enabling lighting |
---|
16689 | 16696 | // causes the normals to be sent down. Thanks to Ken Dyke. |
---|
16690 | 16697 | //gl.glEnable(GL.GL_LIGHTING); |
---|
16691 | | - gl.glEnable(GL.GL_LIGHTING); |
---|
| 16698 | + gl.glDisable(GL.GL_LIGHTING); |
---|
16692 | 16699 | |
---|
16693 | 16700 | gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP); |
---|
16694 | 16701 | gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP); |
---|