.. | .. |
---|
10392 | 10392 | ambientOcclusion = false; |
---|
10393 | 10393 | } |
---|
10394 | 10394 | |
---|
10395 | | - if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN) |
---|
| 10395 | + if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10396 | 10396 | { |
---|
10397 | 10397 | //if (RENDERSHADOW) // ? |
---|
10398 | 10398 | if (!IsFrozen()) |
---|
10399 | 10399 | { |
---|
10400 | 10400 | // dec 2012 |
---|
10401 | | - if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
| 10401 | + if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
10402 | 10402 | { |
---|
10403 | 10403 | Globals.framecount++; |
---|
10404 | 10404 | shadowbuffer.display(); |
---|
.. | .. |
---|
11552 | 11552 | return; |
---|
11553 | 11553 | } |
---|
11554 | 11554 | |
---|
11555 | | - String string = obj.GetToolTip(); |
---|
| 11555 | + String string = obj.toString(); //.GetToolTip(); |
---|
11556 | 11556 | |
---|
11557 | 11557 | GL gl = GetGL(); |
---|
11558 | 11558 | |
---|
.. | .. |
---|
12502 | 12502 | |
---|
12503 | 12503 | // display shadow only (bump == 0) |
---|
12504 | 12504 | "SUB temp.x, half.x, shadow.x;" + |
---|
12505 | | - "MOV temp.y, -params6.x;" + |
---|
12506 | | - "SLT temp.z, temp.y, zero.x;" + |
---|
| 12505 | + "MOV temp.y, -params5.z;" + // params6.x;" + |
---|
| 12506 | + "SLT temp.z, temp.y, -one2048th.x;" + |
---|
12507 | 12507 | "SUB temp.y, one.x, temp.z;" + |
---|
12508 | 12508 | "MUL temp.x, temp.x, temp.y;" + |
---|
12509 | 12509 | "KIL temp.x;" + |
---|
.. | .. |
---|
12834 | 12834 | //once = true; |
---|
12835 | 12835 | } |
---|
12836 | 12836 | |
---|
12837 | | - System.out.print("Program #" + mode + "; length = " + program.length()); |
---|
| 12837 | + System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
12838 | 12838 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
12839 | 12839 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
12840 | 12840 | |
---|
.. | .. |
---|
12967 | 12967 | |
---|
12968 | 12968 | "ADD " + depth + ".z, " + depth + ".z, temp.x;" + |
---|
12969 | 12969 | //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing! |
---|
| 12970 | + |
---|
| 12971 | + // Compare fragment depth in light space with shadowmap. |
---|
12970 | 12972 | "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
12971 | 12973 | "SGE temp.y, temp.x, zero.x;" + |
---|
12972 | | - "SUB " + shadow + ".y, one.x, temp.y;" + |
---|
| 12974 | + "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded |
---|
| 12975 | + |
---|
| 12976 | + // Reverse comparison |
---|
12973 | 12977 | "SUB temp.x, one.x, temp.x;" + |
---|
12974 | 12978 | "MUL " + shadow + ".x, temp.x, temp.y;" + |
---|
12975 | | - "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded |
---|
| 12979 | + "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse |
---|
12976 | 12980 | "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth |
---|
12977 | 12981 | |
---|
12978 | 12982 | "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
.. | .. |
---|
12986 | 12990 | // No shadow for backface |
---|
12987 | 12991 | "DP3 temp.x, normal, lightd;" + |
---|
12988 | 12992 | "SLT temp.x, temp.x, zero.x;" + // shadoweps |
---|
| 12993 | + "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
| 12994 | + |
---|
| 12995 | + // No shadow when out of frustrum |
---|
| 12996 | + "SGE temp.x, " + depth + ".z, one.z;" + |
---|
12989 | 12997 | "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
12990 | 12998 | ""; |
---|
12991 | 12999 | } |
---|
.. | .. |
---|
14366 | 14374 | public void mouseReleased(MouseEvent e) |
---|
14367 | 14375 | { |
---|
14368 | 14376 | movingcamera = false; |
---|
| 14377 | + X = Y = 0; |
---|
14369 | 14378 | //System.out.println("mouseReleased: " + e); |
---|
14370 | 14379 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14371 | 14380 | } |
---|
.. | .. |
---|
15374 | 15383 | info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom)); |
---|
15375 | 15384 | //Image img = CreateImage(width, height); |
---|
15376 | 15385 | //System.out.println("width = " + width + "; height = " + height + "\n"); |
---|
| 15386 | + |
---|
15377 | 15387 | Graphics gr = g; // img.getGraphics(); |
---|
| 15388 | + |
---|
15378 | 15389 | if (!hasMarquee) |
---|
15379 | 15390 | { |
---|
15380 | 15391 | if (Xmin < Xmax) // !locked) |
---|
.. | .. |
---|
15472 | 15483 | if (!isRenderer) |
---|
15473 | 15484 | { |
---|
15474 | 15485 | object.drawEditHandles(info, 0); |
---|
| 15486 | + |
---|
| 15487 | + if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15488 | + { |
---|
| 15489 | + switch (object.selection.get(0).hitSomething) |
---|
| 15490 | + { |
---|
| 15491 | + case Object3D.hitCenter: gr.setColor(Color.pink); break; |
---|
| 15492 | + case Object3D.hitRotate: gr.setColor(Color.green); break; |
---|
| 15493 | + case Object3D.hitScale: gr.setColor(Color.cyan); break; |
---|
| 15494 | + } |
---|
| 15495 | + |
---|
| 15496 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15497 | + } |
---|
15475 | 15498 | } |
---|
15476 | 15499 | } |
---|
| 15500 | + |
---|
15477 | 15501 | if (isRenderer) |
---|
15478 | 15502 | { |
---|
15479 | 15503 | //gr.setColor(Color.black); |
---|
15480 | 15504 | //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1); |
---|
15481 | 15505 | //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3); |
---|
15482 | 15506 | } |
---|
| 15507 | + |
---|
15483 | 15508 | if (hasMarquee) |
---|
15484 | 15509 | { |
---|
15485 | 15510 | gr.setXORMode(Color.white); |
---|