.. | .. |
---|
168 | 168 | |
---|
169 | 169 | |
---|
170 | 170 | // OPTIONS |
---|
171 | | - boolean Skinshader = true; |
---|
| 171 | + boolean Skinshader = false; // true; |
---|
172 | 172 | boolean cameraLight = false; |
---|
173 | 173 | boolean UVdebug = false; |
---|
174 | 174 | boolean Udebug = false; |
---|
.. | .. |
---|
542 | 542 | LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1); |
---|
543 | 543 | LA.vecCross(obj.v0, obj.v1, obj.v2); |
---|
544 | 544 | LA.vecNormalize(obj.v2); |
---|
545 | | - gl.glNormal3f((float) obj.v2.x, (float) obj.v2.y, (float) obj.v2.z); |
---|
| 545 | + |
---|
| 546 | + SetGLNormal(gl, (float) obj.v2.x, (float) obj.v2.y, (float) obj.v2.z); |
---|
546 | 547 | } |
---|
547 | 548 | |
---|
548 | 549 | // P |
---|
.. | .. |
---|
564 | 565 | y += ny * obj.NORMALPUSH; |
---|
565 | 566 | z += nz * obj.NORMALPUSH; |
---|
566 | 567 | |
---|
567 | | - gl.glNormal3f(nx, ny, nz); |
---|
| 568 | + SetGLNormal(gl, nx, ny, nz); |
---|
568 | 569 | } |
---|
569 | 570 | gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
570 | 571 | SetColor(obj, pv); |
---|
.. | .. |
---|
596 | 597 | y += ny * obj.NORMALPUSH; |
---|
597 | 598 | z += nz * obj.NORMALPUSH; |
---|
598 | 599 | |
---|
599 | | - gl.glNormal3f(nx, ny, nz); |
---|
| 600 | + SetGLNormal(gl, nx, ny, nz); |
---|
600 | 601 | } |
---|
601 | 602 | //System.out.println("vertexq = " + qv.s + ", " + qv.t); |
---|
602 | 603 | // boolean locked = false; |
---|
.. | .. |
---|
644 | 645 | y += ny * obj.NORMALPUSH; |
---|
645 | 646 | z += nz * obj.NORMALPUSH; |
---|
646 | 647 | |
---|
647 | | - gl.glNormal3f(nx, ny, nz); |
---|
| 648 | + SetGLNormal(gl, nx, ny, nz); |
---|
648 | 649 | } |
---|
649 | 650 | |
---|
650 | 651 | // if ((dot&4) == 0) |
---|
.. | .. |
---|
880 | 881 | //// tris.postdraw(this); |
---|
881 | 882 | } |
---|
882 | 883 | |
---|
883 | | - static Camera localcamera = new Camera(); |
---|
| 884 | + static Camera localAOcamera = new Camera(); |
---|
884 | 885 | static cVector from = new cVector(); |
---|
885 | 886 | static cVector to = new cVector(); |
---|
886 | 887 | |
---|
.. | .. |
---|
889 | 890 | CameraPane cp = this; |
---|
890 | 891 | |
---|
891 | 892 | Camera keep = cp.RenderCamera(); |
---|
892 | | - cp.renderCamera = localcamera; |
---|
| 893 | + cp.renderCamera = localAOcamera; |
---|
893 | 894 | |
---|
894 | 895 | if (br.trimmed) |
---|
895 | 896 | { |
---|
.. | .. |
---|
907 | 908 | br.positions[i3 + 2] + br.normals[i3 + 2]); |
---|
908 | 909 | LA.xformPos(from, transform, from); |
---|
909 | 910 | LA.xformPos(to, transform, to); // RIGID ONLY |
---|
910 | | - localcamera.setAim(from, to); |
---|
| 911 | + localAOcamera.setAim(from, to); |
---|
911 | 912 | |
---|
912 | 913 | CameraPane.occlusionbuffer.display(); |
---|
913 | 914 | |
---|
.. | .. |
---|
941 | 942 | to.set(v.x+v.norm.x, v.y+v.norm.y, v.z+v.norm.z); |
---|
942 | 943 | LA.xformPos(from, transform, from); |
---|
943 | 944 | LA.xformPos(to, transform, to); // RIGID ONLY |
---|
944 | | - localcamera.setAim(from, to); |
---|
| 945 | + localAOcamera.setAim(from, to); |
---|
945 | 946 | |
---|
946 | 947 | CameraPane.occlusionbuffer.display(); |
---|
947 | 948 | |
---|
.. | .. |
---|
1250 | 1251 | { |
---|
1251 | 1252 | if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
1252 | 1253 | { |
---|
1253 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
| 1254 | + SetGLNormal(gl, n[count3], n[count3 + 1], n[count3 + 2]); |
---|
1254 | 1255 | } else |
---|
1255 | 1256 | { |
---|
1256 | | - gl.glNormal3f(0, 0, 1); |
---|
| 1257 | + SetGLNormal(gl, 0, 0, 1); |
---|
1257 | 1258 | } |
---|
1258 | 1259 | |
---|
1259 | 1260 | if (c != null) |
---|
.. | .. |
---|
1277 | 1278 | { |
---|
1278 | 1279 | if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
1279 | 1280 | { |
---|
1280 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
| 1281 | + SetGLNormal(gl, n[count3], n[count3 + 1], n[count3 + 2]); |
---|
1281 | 1282 | } else |
---|
1282 | 1283 | { |
---|
1283 | | - gl.glNormal3f(0, 0, 1); |
---|
| 1284 | + SetGLNormal(gl, 0, 0, 1); |
---|
1284 | 1285 | } |
---|
1285 | 1286 | if (c != null) |
---|
1286 | 1287 | { |
---|
.. | .. |
---|
1305 | 1306 | { |
---|
1306 | 1307 | if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
1307 | 1308 | { |
---|
1308 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
| 1309 | + SetGLNormal(gl, n[count3], n[count3 + 1], n[count3 + 2]); |
---|
1309 | 1310 | } else |
---|
1310 | 1311 | { |
---|
1311 | | - gl.glNormal3f(0, 0, 1); |
---|
| 1312 | + SetGLNormal(gl, 0, 0, 1); |
---|
1312 | 1313 | } |
---|
1313 | 1314 | if (c != null) |
---|
1314 | 1315 | { |
---|
.. | .. |
---|
1490 | 1491 | { |
---|
1491 | 1492 | if (!selectmode) |
---|
1492 | 1493 | { |
---|
1493 | | - gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z); |
---|
| 1494 | + SetGLNormal(gl, (float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z); |
---|
1494 | 1495 | gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
1495 | 1496 | |
---|
1496 | 1497 | if (flipV) |
---|
.. | .. |
---|
1819 | 1820 | |
---|
1820 | 1821 | display.modelParams7[0] = 0; |
---|
1821 | 1822 | display.modelParams7[1] = 1000; |
---|
1822 | | - display.modelParams7[2] = 0; |
---|
| 1823 | + display.modelParams7[2] = material.parallax; |
---|
1823 | 1824 | display.modelParams7[3] = 0; |
---|
1824 | 1825 | |
---|
1825 | 1826 | //display.modelParams6[0] = 100; // criss de bug de bump |
---|
.. | .. |
---|
2052 | 2053 | switch(viewcode) |
---|
2053 | 2054 | { |
---|
2054 | 2055 | case 0: return "main"; |
---|
2055 | | - case 1: return "one"; |
---|
2056 | | - case 2: return "two"; |
---|
2057 | | - case 3: return "three"; |
---|
| 2056 | + case 1: return "Red"; |
---|
| 2057 | + case 2: return "Green"; |
---|
| 2058 | + case 3: return "Blue"; |
---|
2058 | 2059 | case 4: return "light"; |
---|
2059 | 2060 | } |
---|
2060 | 2061 | |
---|
.. | .. |
---|
2473 | 2474 | byte[] bytes = bytebuf.array(); |
---|
2474 | 2475 | |
---|
2475 | 2476 | return CreateBim(bytes, width, height); |
---|
| 2477 | + } |
---|
| 2478 | + |
---|
| 2479 | + private void SetGLNormal(javax.media.opengl.GL gl, float nx, float ny, float nz) |
---|
| 2480 | + { |
---|
| 2481 | + gl.glNormal3f(nx, ny, nz); |
---|
| 2482 | + |
---|
| 2483 | + if (ny > 0.9 || ny < -0.9) |
---|
| 2484 | + // Ground or ceiling |
---|
| 2485 | + gl.glVertexAttrib3f(4, 1, 0, 0); |
---|
| 2486 | + else |
---|
| 2487 | + // Walls |
---|
| 2488 | + gl.glVertexAttrib3f(4, 0, 1, 0); |
---|
2476 | 2489 | } |
---|
2477 | 2490 | |
---|
2478 | 2491 | /**/ |
---|
.. | .. |
---|
10690 | 10703 | static boolean init = false; |
---|
10691 | 10704 | |
---|
10692 | 10705 | double[][] matrix = LA.newMatrix(); |
---|
| 10706 | + |
---|
| 10707 | + // This is to refresh the UI of the material panel. |
---|
| 10708 | + ObjEditor patchMaterial; |
---|
10693 | 10709 | |
---|
10694 | 10710 | public void display(GLAutoDrawable drawable) |
---|
10695 | 10711 | { |
---|
| 10712 | + if (patchMaterial.patchMaterial) |
---|
| 10713 | + { |
---|
| 10714 | + patchMaterial.patchMaterial = false; |
---|
| 10715 | + patchMaterial.objectPanel.setSelectedIndex(1); |
---|
| 10716 | + } |
---|
| 10717 | + |
---|
10696 | 10718 | if (Grafreed.savesound && Grafreed.hassound) |
---|
10697 | 10719 | { |
---|
10698 | 10720 | Grafreed.wav.save(); |
---|
.. | .. |
---|
12492 | 12514 | String programmin = |
---|
12493 | 12515 | // Min shader |
---|
12494 | 12516 | "!!ARBfp1.0\n" + |
---|
12495 | | - "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" + |
---|
12496 | | - "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 };" + |
---|
12497 | 12520 | "PARAM one = { 1.0, 1.0, 1.0, 1.0 };" + |
---|
12498 | 12521 | "PARAM eps = { 0.001, 0.001, 0.001, 1.0 };" + |
---|
12499 | 12522 | "PARAM infinity = { 100000000, 100000000, 100000000, 1.0 };" + |
---|
.. | .. |
---|
12508 | 12531 | "TEMP eye;" + |
---|
12509 | 12532 | "TEMP pos;" + |
---|
12510 | 12533 | |
---|
12511 | | - "MAD normal, fragment.color, zero123.z, -zero123.y;" + |
---|
| 12534 | + "MAD normal, fragment.color, zero12t.z, -zero12t.y;" + |
---|
12512 | 12535 | Normalize("normal") + |
---|
12513 | 12536 | "MOV light, state.light[0].position;" + |
---|
12514 | 12537 | "DP3 ndotl.x, light, normal;" + |
---|
| 12538 | + "MAX ndotl.x, ndotl.x, zero12t.x;" + |
---|
12515 | 12539 | |
---|
12516 | 12540 | // shadow |
---|
12517 | 12541 | "MOV pos, fragment.texcoord[1];" + |
---|
.. | .. |
---|
12527 | 12551 | "MUL ndotl.x, ndotl.x, ndotl.z;" + // Shadow |
---|
12528 | 12552 | |
---|
12529 | 12553 | // Backlit |
---|
12530 | | - "MOV pos.w, zero123.y;" + |
---|
| 12554 | + "MOV pos.w, zero12t.y;" + // one |
---|
12531 | 12555 | "DP4 eye.x, pos, light2cam0;" + |
---|
12532 | 12556 | "DP4 eye.y, pos, light2cam1;" + |
---|
12533 | 12557 | "DP4 eye.z, pos, light2cam2;" + |
---|
.. | .. |
---|
12535 | 12559 | |
---|
12536 | 12560 | "DP3 ndotl.y, -eye, normal;" + |
---|
12537 | 12561 | //"MUL ndotl.y, ndotl.y, pow2.x;" + |
---|
12538 | | - "POW ndotl.y, ndotl.y, pow2.z;" + // backlit |
---|
12539 | | - "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 |
---|
12540 | 12565 | //"SUB ndotl.y, zero123.y, ndotl.y;" + |
---|
12541 | 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;" + |
---|
12542 | 12569 | |
---|
12543 | 12570 | //"MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient |
---|
12544 | 12571 | //"MAX ndotl.x, ndotl.x, pow2.y;" + // Ambient |
---|
12545 | 12572 | |
---|
12546 | 12573 | // Pigment |
---|
12547 | 12574 | "TEX temp, fragment.texcoord[0], texture[0], 2D;" + |
---|
12548 | | - "LRP temp, zero123.w, temp, one;" + // texture proportion |
---|
12549 | | - "MUL temp, temp, ndotl.x;" + |
---|
12550 | | - |
---|
12551 | | - "MUL temp, temp, zero123.z;" + |
---|
| 12575 | + "LRP temp, zero12t.w, temp, one;" + // texture proportion |
---|
| 12576 | + "MUL temp, temp, zero12t.w;" + // Times x |
---|
12552 | 12577 | |
---|
12553 | 12578 | //"MUL temp, temp, ndotl.y;" + |
---|
| 12579 | + "MAD ndotl.x, pow_2.xxxx, ndotl.yyyy, ndotl.x;" + |
---|
12554 | 12580 | |
---|
12555 | | - "MOV temp.w, zero123.y;" + // reset alpha |
---|
| 12581 | + "MUL temp, temp, ndotl.x;" + // lambert |
---|
| 12582 | + |
---|
| 12583 | + "MOV temp.w, zero12t.y;" + // reset alpha |
---|
12556 | 12584 | "MOV result.color, temp;" + |
---|
12557 | 12585 | "END"; |
---|
12558 | 12586 | |
---|
.. | .. |
---|
12584 | 12612 | "PARAM params4 = program.env[4];" + // anisoV, cameralight, selfshadow, shadow |
---|
12585 | 12613 | "PARAM params5 = program.env[5];" + // texture, opacity, fakedepth, shadowbias |
---|
12586 | 12614 | "PARAM params6 = program.env[6];" + // bump, noise, borderfade, fog punchthrough |
---|
12587 | | - "PARAM params7 = program.env[7];" + // noise power, opacity power |
---|
| 12615 | + "PARAM params7 = program.env[7];" + // noise power, opacity power, parallax |
---|
12588 | 12616 | "PARAM options0 = program.env[63];" + // fog density, intensity, elevation |
---|
12589 | 12617 | "PARAM options1 = program.env[62];" + // fog rgb color |
---|
12590 | 12618 | "PARAM options2 = program.env[61];" + // image intensity, subsurface, lightsheen |
---|
.. | .. |
---|
12829 | 12857 | "POW texSamp.a, texSamp.a, params6.w;" + // fog punch through shortcut |
---|
12830 | 12858 | // mar 2013 ??? "KIL alpha.a;" + |
---|
12831 | 12859 | "MOV alpha, texSamp.aaaa;" + // y;" + |
---|
12832 | | - "KIL alpha.a;" + |
---|
| 12860 | + "KIL alpha.a;" + // not sure with parallax mapping |
---|
12833 | 12861 | /* |
---|
12834 | 12862 | "MUL temp.xy, temp, two;" + |
---|
12835 | 12863 | "TXB bump, temp, texture[0], 2D;" + |
---|
.. | .. |
---|
12915 | 12943 | "SUB bump0, bump0, half;" + |
---|
12916 | 12944 | "ADD bump, bump, bump0;" + |
---|
12917 | 12945 | |
---|
12918 | | - "MOV temp.x, texSamp.a;" + |
---|
12919 | | - "LRP texSamp, params5.x, texSamp, one;" + // texture proportion |
---|
12920 | | - //"LRP texSamp0, params5.x, texSamp0, one;" + |
---|
12921 | | - "MOV texSamp.a, temp.x;" + |
---|
12922 | | - |
---|
12923 | 12946 | // double-sided |
---|
12924 | 12947 | /**/ |
---|
12925 | 12948 | (doublesided?"DP3 temp.z, normal, eye;" + |
---|
.. | .. |
---|
12936 | 12959 | "MOV normald, normal;" + |
---|
12937 | 12960 | "MOV normals, normal;" + |
---|
12938 | 12961 | |
---|
| 12962 | + "MOV temp, fragment.texcoord[4];" + |
---|
| 12963 | + |
---|
12939 | 12964 | // UV base |
---|
12940 | 12965 | //"DP3 UP.x,state.matrix.modelview.row[0],Y;" + |
---|
12941 | 12966 | //"DP3 UP.y,state.matrix.modelview.row[1],Y;" + |
---|
12942 | 12967 | //"DP3 UP.z,state.matrix.modelview.row[2],Y;" + |
---|
12943 | | - "DP3 UP.x,state.matrix.texture[7].row[0],Y;" + |
---|
12944 | | - "DP3 UP.y,state.matrix.texture[7].row[1],Y;" + |
---|
12945 | | - "DP3 UP.z,state.matrix.texture[7].row[2],Y;" + |
---|
| 12968 | + "DP3 UP.x,state.matrix.texture[7].row[0],temp;" + |
---|
| 12969 | + "DP3 UP.y,state.matrix.texture[7].row[1],temp;" + |
---|
| 12970 | + "DP3 UP.z,state.matrix.texture[7].row[2],temp;" + |
---|
| 12971 | + Normalize("UP") + |
---|
| 12972 | + |
---|
12946 | 12973 | "XPD V, normal, UP;" + |
---|
12947 | 12974 | Normalize("V") + |
---|
12948 | 12975 | "XPD U, V, normal;" + |
---|
12949 | 12976 | Normalize("U") + |
---|
12950 | 12977 | |
---|
12951 | 12978 | // parallax mapping |
---|
| 12979 | + |
---|
| 12980 | + "DP3 temp2.x, V, eye;" + |
---|
| 12981 | + "DP3 temp2.y, U, eye;" + |
---|
| 12982 | + "DP3 temp2.z, normal, eye;" + |
---|
| 12983 | + "RCP temp2.z, temp2.z;" + |
---|
| 12984 | + |
---|
| 12985 | + "DP3 temp2.w, texSamp, texSamp;" + // Height |
---|
| 12986 | + "RSQ temp2.w, temp2.w;" + |
---|
| 12987 | + "RCP temp2.w, temp2.w;" + |
---|
| 12988 | + |
---|
| 12989 | + "SUB temp2.w, temp2.w, half;" + |
---|
| 12990 | +// "SGE temp.x, temp2.w, eps.x;" + |
---|
| 12991 | +// "MUL temp2.w, temp2.w, temp.x;" + |
---|
| 12992 | + |
---|
| 12993 | + //"MOV texSamp, U;" + |
---|
| 12994 | + |
---|
| 12995 | + "MUL temp2.z, temp2.z, temp2.w;" + |
---|
| 12996 | + "MUL temp2.z, temp2.z, params7.z;" + // parallax |
---|
| 12997 | + |
---|
| 12998 | + "MUL temp2, temp2, temp2.z;" + |
---|
| 12999 | + |
---|
| 13000 | + "MOV temp, fragment.texcoord[0];" + |
---|
| 13001 | + |
---|
| 13002 | + "SUB temp, temp, temp2;" + |
---|
| 13003 | + |
---|
| 13004 | + "TEX temp, temp, texture[0], 2D;" + |
---|
| 13005 | + "POW temp.a, temp.a, params6.w;" + // punch through |
---|
| 13006 | + |
---|
| 13007 | + "ADD texSamp, temp, texSamp;" + |
---|
| 13008 | + "MUL texSamp.xyz, half, texSamp;" + |
---|
| 13009 | + |
---|
| 13010 | + "MOV alpha, texSamp.aaaa;" + |
---|
| 13011 | + |
---|
| 13012 | +// parallax mapping |
---|
| 13013 | + |
---|
| 13014 | + "MOV temp.x, texSamp.a;" + |
---|
| 13015 | + "LRP texSamp, params5.x, texSamp, one;" + // texture proportion |
---|
| 13016 | + //"LRP texSamp0, params5.x, texSamp0, one;" + |
---|
| 13017 | + "MOV texSamp.a, temp.x;" + |
---|
12952 | 13018 | |
---|
12953 | 13019 | //"MOV temp, fragment.texcoord[0];" + |
---|
12954 | 13020 | // |
---|
.. | .. |
---|
13730 | 13796 | /*static*/ float[] modelParams4 = new float[]{0, 0, 0, 0}; // anisoV, cameralight, selfshadow, shadow |
---|
13731 | 13797 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13732 | 13798 | /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough |
---|
13733 | | - /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power |
---|
| 13799 | + /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power, parallax |
---|
13734 | 13800 | |
---|
13735 | 13801 | //Object3D.cVector2[] vector2buffer; |
---|
13736 | 13802 | |
---|
.. | .. |
---|
13897 | 13963 | "PARAM p[4] = { state.matrix.projection }; # modelview projection matrix\n" + |
---|
13898 | 13964 | "PARAM zero = { 0.0, 0.0, 0.0, 1.0 };" + |
---|
13899 | 13965 | "PARAM half = { 0.5, 0.5, 0.5, 1.0 };" + |
---|
13900 | | - "PARAM one = { 1.0, 1.0, 1.0, 0.0 };" + |
---|
| 13966 | + "PARAM one = { 1.0, 1.0, 1.0, 1.0 };" + |
---|
13901 | 13967 | "PARAM two = { 2.0, 2.0, 2.0, 1.0 };" + |
---|
13902 | 13968 | "PARAM third = { 0.33333333333, 0.33333333333, 0.33333333333, 1.0 };" + |
---|
13903 | 13969 | //"PARAM v256 = { 256.0, 256.0, 256.0, 1.0 };" + |
---|
.. | .. |
---|
13958 | 14024 | "DP4 temp.x,state.matrix.texture[0].inverse.row[0],vertex.texcoord;" + |
---|
13959 | 14025 | "DP4 temp.y,state.matrix.texture[0].inverse.row[1],vertex.texcoord;" + |
---|
13960 | 14026 | "DP4 temp.z,state.matrix.texture[0].inverse.row[2],vertex.texcoord;" + |
---|
13961 | | - //"MOV result.texcoord, vertex.texcoord;" + |
---|
| 14027 | + //"MOV result.texcoord, vertex.fogcoord;" + |
---|
13962 | 14028 | "MOV result.texcoord, temp;" + |
---|
13963 | 14029 | // border fade |
---|
13964 | 14030 | "MOV result.texcoord[3], vertex.texcoord;" + |
---|
.. | .. |
---|
14005 | 14071 | |
---|
14006 | 14072 | //"ADD temp.z, temp.z, one;" + |
---|
14007 | 14073 | |
---|
14008 | | - "MOV result.color, temp;" |
---|
| 14074 | + "MOV result.texcoord[4], vertex.attrib[4];" + // U dir |
---|
| 14075 | + |
---|
| 14076 | + "MOV result.color, temp;" // Normal |
---|
14009 | 14077 | : "MOV result.color, vertex.color;") + |
---|
14010 | 14078 | ((mode & VP_PROJECTION) != 0 ? "MOV result.color, zero;" |
---|
14011 | 14079 | : "") + |
---|
.. | .. |
---|
15282 | 15350 | case 'K': |
---|
15283 | 15351 | KOMPACTTEXTURE ^= true; |
---|
15284 | 15352 | //textures.clear(); |
---|
15285 | | - break; |
---|
15286 | | - case 'P': // Texture Projection macros |
---|
| 15353 | + // break; |
---|
| 15354 | + //case 'P': // Texture Projection macros |
---|
15287 | 15355 | // SAVETEXTURE ^= true; |
---|
15288 | 15356 | macromode = true; |
---|
15289 | 15357 | Udebug = Vdebug = NORMALdebug = false; programInitialized = false; |
---|
.. | .. |
---|
15404 | 15472 | targetLookAt.set(manipCamera.lookAt); |
---|
15405 | 15473 | repaint(); |
---|
15406 | 15474 | break; |
---|
15407 | | - case 'p': |
---|
| 15475 | + case 'P': // p': |
---|
15408 | 15476 | // c'est quoi ca au juste? spherical ^= true; |
---|
15409 | 15477 | Skinshader ^= true; programInitialized = false; |
---|
15410 | 15478 | repaint(); |
---|
.. | .. |
---|
15442 | 15510 | repaint(); |
---|
15443 | 15511 | break; |
---|
15444 | 15512 | case 'O': |
---|
15445 | | - Globals.drawMode = OCCLUSION; // WARNING |
---|
| 15513 | + // Too dangerous. Use menu. Globals.drawMode = OCCLUSION; // WARNING |
---|
15446 | 15514 | repaint(); |
---|
15447 | 15515 | break; |
---|
15448 | 15516 | case 'o': |
---|
.. | .. |
---|
16886 | 16954 | gl.glScalef(1.0f, -1.0f, 1.0f); |
---|
16887 | 16955 | } |
---|
16888 | 16956 | |
---|
16889 | | - gl.glNormal3f(0.0f, 0.0f, 1.0f); |
---|
| 16957 | + SetGLNormal(gl, 0.0f, 0.0f, 1.0f); |
---|
16890 | 16958 | |
---|
16891 | 16959 | float step = 2; // 0.1666f; //0.25f; |
---|
16892 | 16960 | float stepv = 2; // step * 1652 / 998; |
---|