Normand Briere
2019-06-11 d0dc7ff35d71919d503ae35592478b173cf3cfd3
CameraPane.java
....@@ -10392,13 +10392,13 @@
1039210392 ambientOcclusion = false;
1039310393 }
1039410394
10395
- if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN)
10395
+ if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1039610396 {
1039710397 //if (RENDERSHADOW) // ?
1039810398 if (!IsFrozen())
1039910399 {
1040010400 // dec 2012
10401
- if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0))
10401
+ if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0))
1040210402 {
1040310403 Globals.framecount++;
1040410404 shadowbuffer.display();
....@@ -11552,7 +11552,7 @@
1155211552 return;
1155311553 }
1155411554
11555
- String string = obj.GetToolTip();
11555
+ String string = obj.toString(); //.GetToolTip();
1155611556
1155711557 GL gl = GetGL();
1155811558
....@@ -12502,8 +12502,8 @@
1250212502
1250312503 // display shadow only (bump == 0)
1250412504 "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;" +
1250712507 "SUB temp.y, one.x, temp.z;" +
1250812508 "MUL temp.x, temp.x, temp.y;" +
1250912509 "KIL temp.x;" +
....@@ -12834,7 +12834,7 @@
1283412834 //once = true;
1283512835 }
1283612836
12837
- System.out.print("Program #" + mode + "; length = " + program.length());
12837
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1283812838 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1283912839 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1284012840
....@@ -12967,12 +12967,16 @@
1296712967
1296812968 "ADD " + depth + ".z, " + depth + ".z, temp.x;" +
1296912969 //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing!
12970
+
12971
+ // Compare fragment depth in light space with shadowmap.
1297012972 "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" +
1297112973 "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
1297312977 "SUB temp.x, one.x, temp.x;" +
1297412978 "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
1297612980 "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth
1297712981
1297812982 "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" +
....@@ -12986,6 +12990,10 @@
1298612990 // No shadow for backface
1298712991 "DP3 temp.x, normal, lightd;" +
1298812992 "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;" +
1298912997 "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
1299012998 "";
1299112999 }
....@@ -14366,6 +14374,7 @@
1436614374 public void mouseReleased(MouseEvent e)
1436714375 {
1436814376 movingcamera = false;
14377
+ X = Y = 0;
1436914378 //System.out.println("mouseReleased: " + e);
1437014379 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1437114380 }
....@@ -15374,7 +15383,9 @@
1537415383 info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
1537515384 //Image img = CreateImage(width, height);
1537615385 //System.out.println("width = " + width + "; height = " + height + "\n");
15386
+
1537715387 Graphics gr = g; // img.getGraphics();
15388
+
1537815389 if (!hasMarquee)
1537915390 {
1538015391 if (Xmin < Xmax) // !locked)
....@@ -15472,14 +15483,28 @@
1547215483 if (!isRenderer)
1547315484 {
1547415485 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
+ }
1547515498 }
1547615499 }
15500
+
1547715501 if (isRenderer)
1547815502 {
1547915503 //gr.setColor(Color.black);
1548015504 //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1);
1548115505 //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3);
1548215506 }
15507
+
1548315508 if (hasMarquee)
1548415509 {
1548515510 gr.setXORMode(Color.white);