.. | .. |
---|
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; |
---|
.. | .. |
---|
1819 | 1819 | |
---|
1820 | 1820 | display.modelParams7[0] = 0; |
---|
1821 | 1821 | display.modelParams7[1] = 1000; |
---|
1822 | | - display.modelParams7[2] = 0; |
---|
| 1822 | + display.modelParams7[2] = material.parallax; |
---|
1823 | 1823 | display.modelParams7[3] = 0; |
---|
1824 | 1824 | |
---|
1825 | 1825 | //display.modelParams6[0] = 100; // criss de bug de bump |
---|
.. | .. |
---|
2052 | 2052 | switch(viewcode) |
---|
2053 | 2053 | { |
---|
2054 | 2054 | case 0: return "main"; |
---|
2055 | | - case 1: return "one"; |
---|
2056 | | - case 2: return "two"; |
---|
2057 | | - case 3: return "three"; |
---|
| 2055 | + case 1: return "Red"; |
---|
| 2056 | + case 2: return "Green"; |
---|
| 2057 | + case 3: return "Blue"; |
---|
2058 | 2058 | case 4: return "light"; |
---|
2059 | 2059 | } |
---|
2060 | 2060 | |
---|
.. | .. |
---|
10690 | 10690 | static boolean init = false; |
---|
10691 | 10691 | |
---|
10692 | 10692 | double[][] matrix = LA.newMatrix(); |
---|
| 10693 | + |
---|
| 10694 | + // This is to refresh the UI of the material panel. |
---|
| 10695 | + ObjEditor patchMaterial; |
---|
10693 | 10696 | |
---|
10694 | 10697 | public void display(GLAutoDrawable drawable) |
---|
10695 | 10698 | { |
---|
| 10699 | + if (patchMaterial.patchMaterial) |
---|
| 10700 | + { |
---|
| 10701 | + patchMaterial.patchMaterial = false; |
---|
| 10702 | + patchMaterial.objectPanel.setSelectedIndex(1); |
---|
| 10703 | + } |
---|
| 10704 | + |
---|
10696 | 10705 | if (Grafreed.savesound && Grafreed.hassound) |
---|
10697 | 10706 | { |
---|
10698 | 10707 | Grafreed.wav.save(); |
---|
.. | .. |
---|
12584 | 12593 | "PARAM params4 = program.env[4];" + // anisoV, cameralight, selfshadow, shadow |
---|
12585 | 12594 | "PARAM params5 = program.env[5];" + // texture, opacity, fakedepth, shadowbias |
---|
12586 | 12595 | "PARAM params6 = program.env[6];" + // bump, noise, borderfade, fog punchthrough |
---|
12587 | | - "PARAM params7 = program.env[7];" + // noise power, opacity power |
---|
| 12596 | + "PARAM params7 = program.env[7];" + // noise power, opacity power, parallax |
---|
12588 | 12597 | "PARAM options0 = program.env[63];" + // fog density, intensity, elevation |
---|
12589 | 12598 | "PARAM options1 = program.env[62];" + // fog rgb color |
---|
12590 | 12599 | "PARAM options2 = program.env[61];" + // image intensity, subsurface, lightsheen |
---|
.. | .. |
---|
12829 | 12838 | "POW texSamp.a, texSamp.a, params6.w;" + // fog punch through shortcut |
---|
12830 | 12839 | // mar 2013 ??? "KIL alpha.a;" + |
---|
12831 | 12840 | "MOV alpha, texSamp.aaaa;" + // y;" + |
---|
12832 | | - "KIL alpha.a;" + |
---|
| 12841 | + "KIL alpha.a;" + // not sure with parallax mapping |
---|
12833 | 12842 | /* |
---|
12834 | 12843 | "MUL temp.xy, temp, two;" + |
---|
12835 | 12844 | "TXB bump, temp, texture[0], 2D;" + |
---|
.. | .. |
---|
12915 | 12924 | "SUB bump0, bump0, half;" + |
---|
12916 | 12925 | "ADD bump, bump, bump0;" + |
---|
12917 | 12926 | |
---|
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 | 12927 | // double-sided |
---|
12924 | 12928 | /**/ |
---|
12925 | 12929 | (doublesided?"DP3 temp.z, normal, eye;" + |
---|
.. | .. |
---|
12949 | 12953 | Normalize("U") + |
---|
12950 | 12954 | |
---|
12951 | 12955 | // parallax mapping |
---|
| 12956 | + |
---|
| 12957 | + "DP3 temp2.x, V, eye;" + |
---|
| 12958 | + "DP3 temp2.y, U, eye;" + |
---|
| 12959 | + "DP3 temp2.z, normal, eye;" + |
---|
| 12960 | + "RCP temp2.z, temp2.z;" + |
---|
| 12961 | + |
---|
| 12962 | + "DP3 temp2.w, texSamp, texSamp;" + // Height |
---|
| 12963 | + "RSQ temp2.w, temp2.w;" + |
---|
| 12964 | + "RCP temp2.w, temp2.w;" + |
---|
| 12965 | + |
---|
| 12966 | + "SUB temp2.w, temp2.w, half;" + |
---|
| 12967 | +// "SGE temp.x, temp2.w, eps.x;" + |
---|
| 12968 | +// "MUL temp2.w, temp2.w, temp.x;" + |
---|
| 12969 | + |
---|
| 12970 | + //"MOV texSamp, U;" + |
---|
| 12971 | + |
---|
| 12972 | + "MUL temp2.z, temp2.z, temp2.w;" + |
---|
| 12973 | + "MUL temp2.z, temp2.z, params7.z;" + // parallax |
---|
| 12974 | + |
---|
| 12975 | + "MUL temp2, temp2, temp2.z;" + |
---|
| 12976 | + |
---|
| 12977 | + "MOV temp, fragment.texcoord[0];" + |
---|
| 12978 | + |
---|
| 12979 | + "SUB temp, temp, temp2;" + |
---|
| 12980 | + |
---|
| 12981 | + "TEX texSamp, temp, texture[0], 2D;" + |
---|
| 12982 | + "POW texSamp.a, texSamp.a, params6.w;" + // punch through |
---|
| 12983 | + "MOV alpha, texSamp.aaaa;" + |
---|
| 12984 | + |
---|
| 12985 | +// parallax mapping |
---|
| 12986 | + |
---|
| 12987 | + "MOV temp.x, texSamp.a;" + |
---|
| 12988 | + "LRP texSamp, params5.x, texSamp, one;" + // texture proportion |
---|
| 12989 | + //"LRP texSamp0, params5.x, texSamp0, one;" + |
---|
| 12990 | + "MOV texSamp.a, temp.x;" + |
---|
12952 | 12991 | |
---|
12953 | 12992 | //"MOV temp, fragment.texcoord[0];" + |
---|
12954 | 12993 | // |
---|
.. | .. |
---|
13730 | 13769 | /*static*/ float[] modelParams4 = new float[]{0, 0, 0, 0}; // anisoV, cameralight, selfshadow, shadow |
---|
13731 | 13770 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13732 | 13771 | /*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 |
---|
| 13772 | + /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power, parallax |
---|
13734 | 13773 | |
---|
13735 | 13774 | //Object3D.cVector2[] vector2buffer; |
---|
13736 | 13775 | |
---|
.. | .. |
---|
15282 | 15321 | case 'K': |
---|
15283 | 15322 | KOMPACTTEXTURE ^= true; |
---|
15284 | 15323 | //textures.clear(); |
---|
15285 | | - break; |
---|
15286 | | - case 'P': // Texture Projection macros |
---|
| 15324 | + // break; |
---|
| 15325 | + //case 'P': // Texture Projection macros |
---|
15287 | 15326 | // SAVETEXTURE ^= true; |
---|
15288 | 15327 | macromode = true; |
---|
15289 | 15328 | Udebug = Vdebug = NORMALdebug = false; programInitialized = false; |
---|
.. | .. |
---|
15404 | 15443 | targetLookAt.set(manipCamera.lookAt); |
---|
15405 | 15444 | repaint(); |
---|
15406 | 15445 | break; |
---|
15407 | | - case 'p': |
---|
| 15446 | + case 'P': // p': |
---|
15408 | 15447 | // c'est quoi ca au juste? spherical ^= true; |
---|
15409 | 15448 | Skinshader ^= true; programInitialized = false; |
---|
15410 | 15449 | repaint(); |
---|