.. | .. |
---|
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); |
---|
.. | .. |
---|
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); |
---|
.. | .. |
---|
7 | 7 | static iCameraPane theRenderer; |
---|
8 | 8 | |
---|
9 | 9 | private static boolean LIVE = false; |
---|
| 10 | + |
---|
| 11 | + public static boolean MINSHADER = false; |
---|
10 | 12 | public static boolean COMPUTESHADOWWHENLIVE = true; |
---|
11 | 13 | public static boolean RENDERSHADOW = true; |
---|
12 | 14 | |
---|
.. | .. |
---|
1234 | 1234 | smoothCB.setToolTipText("Snapping delay"); |
---|
1235 | 1235 | smoothCB.addItemListener(this); |
---|
1236 | 1236 | |
---|
1237 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
1238 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
1239 | | - slowCB.addItemListener(this); |
---|
| 1237 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1238 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1239 | +// slowCB.addItemListener(this); |
---|
| 1240 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1241 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1242 | + minshaderCB.addItemListener(this); |
---|
1240 | 1243 | |
---|
1241 | 1244 | // constraints.gridy += 1; |
---|
1242 | 1245 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
1350 | 1353 | cCheckBox localCB; |
---|
1351 | 1354 | cCheckBox crowdCB; |
---|
1352 | 1355 | cCheckBox smoothCB; |
---|
| 1356 | + cCheckBox minshaderCB; |
---|
| 1357 | + |
---|
1353 | 1358 | cToggleButton fastCB; |
---|
1354 | 1359 | cCheckBox slowCB; |
---|
1355 | 1360 | cCheckBox boxCB; |
---|
.. | .. |
---|
1421 | 1426 | cameraView.ToggleInertia(); |
---|
1422 | 1427 | cameraView.repaint(); |
---|
1423 | 1428 | } |
---|
| 1429 | + else if(e.getSource() == minshaderCB) |
---|
| 1430 | + { |
---|
| 1431 | + Globals.MINSHADER ^= true; |
---|
| 1432 | + cameraView.programInitialized = false; |
---|
| 1433 | + cameraView.repaint(); |
---|
| 1434 | + } |
---|
1424 | 1435 | else if(e.getSource() == localCB) |
---|
1425 | 1436 | { |
---|
1426 | 1437 | cameraView.ToggleLocal(); |
---|