Normand Briere
2019-08-26 6266c8a4b2485b29a7d5bcb217460d7aad3e1c4a
CameraPane.java
....@@ -881,7 +881,7 @@
881881 //// tris.postdraw(this);
882882 }
883883
884
- static Camera localcamera = new Camera();
884
+ static Camera localAOcamera = new Camera();
885885 static cVector from = new cVector();
886886 static cVector to = new cVector();
887887
....@@ -890,7 +890,7 @@
890890 CameraPane cp = this;
891891
892892 Camera keep = cp.RenderCamera();
893
- cp.renderCamera = localcamera;
893
+ cp.renderCamera = localAOcamera;
894894
895895 if (br.trimmed)
896896 {
....@@ -908,7 +908,7 @@
908908 br.positions[i3 + 2] + br.normals[i3 + 2]);
909909 LA.xformPos(from, transform, from);
910910 LA.xformPos(to, transform, to); // RIGID ONLY
911
- localcamera.setAim(from, to);
911
+ localAOcamera.setAim(from, to);
912912
913913 CameraPane.occlusionbuffer.display();
914914
....@@ -942,7 +942,7 @@
942942 to.set(v.x+v.norm.x, v.y+v.norm.y, v.z+v.norm.z);
943943 LA.xformPos(from, transform, from);
944944 LA.xformPos(to, transform, to); // RIGID ONLY
945
- localcamera.setAim(from, to);
945
+ localAOcamera.setAim(from, to);
946946
947947 CameraPane.occlusionbuffer.display();
948948
....@@ -12514,8 +12514,9 @@
1251412514 String programmin =
1251512515 // Min shader
1251612516 "!!ARBfp1.0\n" +
12517
- "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" +
12518
- "PARAM pow2 = { 0.5, 0.25, 0.125, 0.0 };" +
12517
+ "PARAM zero12t = { 0.0, 1.0, 2, 1.25 };" +
12518
+ "PARAM pow_2 = { 0.5, 0.25, 0.125, 0.0 };" +
12519
+ "PARAM pow2 = { 2, 4, 8, 0.0 };" +
1251912520 "PARAM one = { 1.0, 1.0, 1.0, 1.0 };" +
1252012521 "PARAM eps = { 0.001, 0.001, 0.001, 1.0 };" +
1252112522 "PARAM infinity = { 100000000, 100000000, 100000000, 1.0 };" +
....@@ -12530,10 +12531,11 @@
1253012531 "TEMP eye;" +
1253112532 "TEMP pos;" +
1253212533
12533
- "MAD normal, fragment.color, zero123.z, -zero123.y;" +
12534
+ "MAD normal, fragment.color, zero12t.z, -zero12t.y;" +
1253412535 Normalize("normal") +
1253512536 "MOV light, state.light[0].position;" +
1253612537 "DP3 ndotl.x, light, normal;" +
12538
+ "MAX ndotl.x, ndotl.x, zero12t.x;" +
1253712539
1253812540 // shadow
1253912541 "MOV pos, fragment.texcoord[1];" +
....@@ -12549,7 +12551,7 @@
1254912551 "MUL ndotl.x, ndotl.x, ndotl.z;" + // Shadow
1255012552
1255112553 // Backlit
12552
- "MOV pos.w, zero123.y;" +
12554
+ "MOV pos.w, zero12t.y;" + // one
1255312555 "DP4 eye.x, pos, light2cam0;" +
1255412556 "DP4 eye.y, pos, light2cam1;" +
1255512557 "DP4 eye.z, pos, light2cam2;" +
....@@ -12557,24 +12559,28 @@
1255712559
1255812560 "DP3 ndotl.y, -eye, normal;" +
1255912561 //"MUL ndotl.y, ndotl.y, pow2.x;" +
12560
- "POW ndotl.y, ndotl.y, pow2.z;" + // backlit
12561
- "SUB ndotl.y, zero123.y, ndotl.y;" +
12562
+ "POW ndotl.y, ndotl.y, pow2.x;" + // backlit
12563
+ "SUB ndotl.y, zero12t.y, ndotl.y;" + // 1 - y
12564
+ //"POW ndotl.y, ndotl.y, pow2.z;" + // backlit
1256212565 //"SUB ndotl.y, zero123.y, ndotl.y;" +
1256312566 //"MUL ndotl.y, ndotl.y, pow2.z;" +
12567
+ "ADD ndotl.y, ndotl.y, one.x;" +
12568
+ "MUL ndotl.y, ndotl.y, pow_2.x;" +
1256412569
1256512570 //"MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient
1256612571 //"MAX ndotl.x, ndotl.x, pow2.y;" + // Ambient
1256712572
1256812573 // Pigment
1256912574 "TEX temp, fragment.texcoord[0], texture[0], 2D;" +
12570
- "LRP temp, zero123.w, temp, one;" + // texture proportion
12571
- "MUL temp, temp, ndotl.x;" +
12572
-
12573
- "MUL temp, temp, zero123.z;" +
12575
+ "LRP temp, zero12t.w, temp, one;" + // texture proportion
12576
+ "MUL temp, temp, zero12t.w;" + // Times x
1257412577
1257512578 //"MUL temp, temp, ndotl.y;" +
12579
+ "MAD ndotl.x, pow_2.xxxx, ndotl.yyyy, ndotl.x;" +
1257612580
12577
- "MOV temp.w, zero123.y;" + // reset alpha
12581
+ "MUL temp, temp, ndotl.x;" + // lambert
12582
+
12583
+ "MOV temp.w, zero12t.y;" + // reset alpha
1257812584 "MOV result.color, temp;" +
1257912585 "END";
1258012586
....@@ -12946,12 +12952,7 @@
1294612952 "ADD temp.x, temp.x, one.x;" +
1294712953 "MUL normal, normal, temp.xxxx;":""
1294812954 ) +
12949
- /**/
12950
-//// Normalize("normal") +
12951
-//// "MAX normal.z, eps.x, normal.z;" +
12952
-// Normalize("normal") +
12953
- "MOV normald, normal;" +
12954
- "MOV normals, normal;" +
12955
+ /**/
1295512956
1295612957 "MOV temp, fragment.texcoord[4];" +
1295712958
....@@ -12969,6 +12970,17 @@
1296912970 "XPD U, V, normal;" +
1297012971 Normalize("U") +
1297112972
12973
+ "MOV temp, fragment.texcoord[0];" +
12974
+
12975
+// "MAD normal, -temp.x, U, normal;" +
12976
+// "MAD normal, -temp.y, V, normal;" +
12977
+// Normalize("normal") +
12978
+
12979
+//// "MAX normal.z, eps.x, normal.z;" +
12980
+// Normalize("normal") +
12981
+ "MOV normald, normal;" +
12982
+ "MOV normals, normal;" +
12983
+
1297212984 // parallax mapping
1297312985
1297412986 "DP3 temp2.x, V, eye;" +
....@@ -12981,17 +12993,15 @@
1298112993 "RCP temp2.w, temp2.w;" +
1298212994
1298312995 "SUB temp2.w, temp2.w, half;" +
12984
-// "SGE temp.x, temp2.w, eps.x;" +
12985
-// "MUL temp2.w, temp2.w, temp.x;" +
12996
+ // "SGE temp.x, temp2.w, eps.x;" +
12997
+ // "MUL temp2.w, temp2.w, temp.x;" +
1298612998
12987
- //"MOV texSamp, U;" +
12999
+ // "MOV texSamp, U;" +
1298813000
1298913001 "MUL temp2.z, temp2.z, temp2.w;" +
1299013002 "MUL temp2.z, temp2.z, params7.z;" + // parallax
1299113003
1299213004 "MUL temp2, temp2, temp2.z;" +
12993
-
12994
- "MOV temp, fragment.texcoord[0];" +
1299513005
1299613006 "SUB temp, temp, temp2;" +
1299713007
....@@ -14726,8 +14736,8 @@
1472614736 }
1472714737 }
1472814738 PingThread pingthread = new PingThread();
14729
- int delta = 5;
14730
- int speed = 5;
14739
+ int delta = 2;
14740
+ int speed = 10;
1473114741 boolean autorepeat = false;
1473214742
1473314743 void GoDown(int mod)