.. | .. |
---|
881 | 881 | //// tris.postdraw(this); |
---|
882 | 882 | } |
---|
883 | 883 | |
---|
884 | | - static Camera localcamera = new Camera(); |
---|
| 884 | + static Camera localAOcamera = new Camera(); |
---|
885 | 885 | static cVector from = new cVector(); |
---|
886 | 886 | static cVector to = new cVector(); |
---|
887 | 887 | |
---|
.. | .. |
---|
890 | 890 | CameraPane cp = this; |
---|
891 | 891 | |
---|
892 | 892 | Camera keep = cp.RenderCamera(); |
---|
893 | | - cp.renderCamera = localcamera; |
---|
| 893 | + cp.renderCamera = localAOcamera; |
---|
894 | 894 | |
---|
895 | 895 | if (br.trimmed) |
---|
896 | 896 | { |
---|
.. | .. |
---|
908 | 908 | br.positions[i3 + 2] + br.normals[i3 + 2]); |
---|
909 | 909 | LA.xformPos(from, transform, from); |
---|
910 | 910 | LA.xformPos(to, transform, to); // RIGID ONLY |
---|
911 | | - localcamera.setAim(from, to); |
---|
| 911 | + localAOcamera.setAim(from, to); |
---|
912 | 912 | |
---|
913 | 913 | CameraPane.occlusionbuffer.display(); |
---|
914 | 914 | |
---|
.. | .. |
---|
942 | 942 | to.set(v.x+v.norm.x, v.y+v.norm.y, v.z+v.norm.z); |
---|
943 | 943 | LA.xformPos(from, transform, from); |
---|
944 | 944 | LA.xformPos(to, transform, to); // RIGID ONLY |
---|
945 | | - localcamera.setAim(from, to); |
---|
| 945 | + localAOcamera.setAim(from, to); |
---|
946 | 946 | |
---|
947 | 947 | CameraPane.occlusionbuffer.display(); |
---|
948 | 948 | |
---|
.. | .. |
---|
12514 | 12514 | String programmin = |
---|
12515 | 12515 | // Min shader |
---|
12516 | 12516 | "!!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 };" + |
---|
12519 | 12520 | "PARAM one = { 1.0, 1.0, 1.0, 1.0 };" + |
---|
12520 | 12521 | "PARAM eps = { 0.001, 0.001, 0.001, 1.0 };" + |
---|
12521 | 12522 | "PARAM infinity = { 100000000, 100000000, 100000000, 1.0 };" + |
---|
.. | .. |
---|
12530 | 12531 | "TEMP eye;" + |
---|
12531 | 12532 | "TEMP pos;" + |
---|
12532 | 12533 | |
---|
12533 | | - "MAD normal, fragment.color, zero123.z, -zero123.y;" + |
---|
| 12534 | + "MAD normal, fragment.color, zero12t.z, -zero12t.y;" + |
---|
12534 | 12535 | Normalize("normal") + |
---|
12535 | 12536 | "MOV light, state.light[0].position;" + |
---|
12536 | 12537 | "DP3 ndotl.x, light, normal;" + |
---|
| 12538 | + "MAX ndotl.x, ndotl.x, zero12t.x;" + |
---|
12537 | 12539 | |
---|
12538 | 12540 | // shadow |
---|
12539 | 12541 | "MOV pos, fragment.texcoord[1];" + |
---|
.. | .. |
---|
12549 | 12551 | "MUL ndotl.x, ndotl.x, ndotl.z;" + // Shadow |
---|
12550 | 12552 | |
---|
12551 | 12553 | // Backlit |
---|
12552 | | - "MOV pos.w, zero123.y;" + |
---|
| 12554 | + "MOV pos.w, zero12t.y;" + // one |
---|
12553 | 12555 | "DP4 eye.x, pos, light2cam0;" + |
---|
12554 | 12556 | "DP4 eye.y, pos, light2cam1;" + |
---|
12555 | 12557 | "DP4 eye.z, pos, light2cam2;" + |
---|
.. | .. |
---|
12557 | 12559 | |
---|
12558 | 12560 | "DP3 ndotl.y, -eye, normal;" + |
---|
12559 | 12561 | //"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 |
---|
12562 | 12565 | //"SUB ndotl.y, zero123.y, ndotl.y;" + |
---|
12563 | 12566 | //"MUL ndotl.y, ndotl.y, pow2.z;" + |
---|
| 12567 | + "ADD ndotl.y, ndotl.y, one.x;" + |
---|
| 12568 | + "MUL ndotl.y, ndotl.y, pow_2.x;" + |
---|
12564 | 12569 | |
---|
12565 | 12570 | //"MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient |
---|
12566 | 12571 | //"MAX ndotl.x, ndotl.x, pow2.y;" + // Ambient |
---|
12567 | 12572 | |
---|
12568 | 12573 | // Pigment |
---|
12569 | 12574 | "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 |
---|
12574 | 12577 | |
---|
12575 | 12578 | //"MUL temp, temp, ndotl.y;" + |
---|
| 12579 | + "MAD ndotl.x, pow_2.xxxx, ndotl.yyyy, ndotl.x;" + |
---|
12576 | 12580 | |
---|
12577 | | - "MOV temp.w, zero123.y;" + // reset alpha |
---|
| 12581 | + "MUL temp, temp, ndotl.x;" + // lambert |
---|
| 12582 | + |
---|
| 12583 | + "MOV temp.w, zero12t.y;" + // reset alpha |
---|
12578 | 12584 | "MOV result.color, temp;" + |
---|
12579 | 12585 | "END"; |
---|
12580 | 12586 | |
---|
.. | .. |
---|
12946 | 12952 | "ADD temp.x, temp.x, one.x;" + |
---|
12947 | 12953 | "MUL normal, normal, temp.xxxx;":"" |
---|
12948 | 12954 | ) + |
---|
12949 | | - /**/ |
---|
12950 | | -//// Normalize("normal") + |
---|
12951 | | -//// "MAX normal.z, eps.x, normal.z;" + |
---|
12952 | | -// Normalize("normal") + |
---|
12953 | | - "MOV normald, normal;" + |
---|
12954 | | - "MOV normals, normal;" + |
---|
| 12955 | + /**/ |
---|
12955 | 12956 | |
---|
12956 | 12957 | "MOV temp, fragment.texcoord[4];" + |
---|
12957 | 12958 | |
---|
.. | .. |
---|
12969 | 12970 | "XPD U, V, normal;" + |
---|
12970 | 12971 | Normalize("U") + |
---|
12971 | 12972 | |
---|
| 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 | + |
---|
12972 | 12984 | // parallax mapping |
---|
12973 | 12985 | |
---|
12974 | 12986 | "DP3 temp2.x, V, eye;" + |
---|
.. | .. |
---|
12981 | 12993 | "RCP temp2.w, temp2.w;" + |
---|
12982 | 12994 | |
---|
12983 | 12995 | "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;" + |
---|
12986 | 12998 | |
---|
12987 | | - //"MOV texSamp, U;" + |
---|
| 12999 | + // "MOV texSamp, U;" + |
---|
12988 | 13000 | |
---|
12989 | 13001 | "MUL temp2.z, temp2.z, temp2.w;" + |
---|
12990 | 13002 | "MUL temp2.z, temp2.z, params7.z;" + // parallax |
---|
12991 | 13003 | |
---|
12992 | 13004 | "MUL temp2, temp2, temp2.z;" + |
---|
12993 | | - |
---|
12994 | | - "MOV temp, fragment.texcoord[0];" + |
---|
12995 | 13005 | |
---|
12996 | 13006 | "SUB temp, temp, temp2;" + |
---|
12997 | 13007 | |
---|
.. | .. |
---|
14726 | 14736 | } |
---|
14727 | 14737 | } |
---|
14728 | 14738 | PingThread pingthread = new PingThread(); |
---|
14729 | | - int delta = 5; |
---|
14730 | | - int speed = 5; |
---|
| 14739 | + int delta = 2; |
---|
| 14740 | + int speed = 10; |
---|
14731 | 14741 | boolean autorepeat = false; |
---|
14732 | 14742 | |
---|
14733 | 14743 | void GoDown(int mod) |
---|