Normand Briere
2019-08-20 564f4d12d93813b5d680fc24d4f118c3886d96ed
CameraPane.java
....@@ -168,7 +168,7 @@
168168
169169
170170 // OPTIONS
171
- boolean Skinshader = true;
171
+ boolean Skinshader = false; // true;
172172 boolean cameraLight = false;
173173 boolean UVdebug = false;
174174 boolean Udebug = false;
....@@ -1819,7 +1819,7 @@
18191819
18201820 display.modelParams7[0] = 0;
18211821 display.modelParams7[1] = 1000;
1822
- display.modelParams7[2] = 0;
1822
+ display.modelParams7[2] = material.parallax;
18231823 display.modelParams7[3] = 0;
18241824
18251825 //display.modelParams6[0] = 100; // criss de bug de bump
....@@ -2052,9 +2052,9 @@
20522052 switch(viewcode)
20532053 {
20542054 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";
20582058 case 4: return "light";
20592059 }
20602060
....@@ -10690,9 +10690,18 @@
1069010690 static boolean init = false;
1069110691
1069210692 double[][] matrix = LA.newMatrix();
10693
+
10694
+ // This is to refresh the UI of the material panel.
10695
+ ObjEditor patchMaterial;
1069310696
1069410697 public void display(GLAutoDrawable drawable)
1069510698 {
10699
+ if (patchMaterial.patchMaterial)
10700
+ {
10701
+ patchMaterial.patchMaterial = false;
10702
+ patchMaterial.objectPanel.setSelectedIndex(1);
10703
+ }
10704
+
1069610705 if (Grafreed.savesound && Grafreed.hassound)
1069710706 {
1069810707 Grafreed.wav.save();
....@@ -12584,7 +12593,7 @@
1258412593 "PARAM params4 = program.env[4];" + // anisoV, cameralight, selfshadow, shadow
1258512594 "PARAM params5 = program.env[5];" + // texture, opacity, fakedepth, shadowbias
1258612595 "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
1258812597 "PARAM options0 = program.env[63];" + // fog density, intensity, elevation
1258912598 "PARAM options1 = program.env[62];" + // fog rgb color
1259012599 "PARAM options2 = program.env[61];" + // image intensity, subsurface, lightsheen
....@@ -12829,7 +12838,7 @@
1282912838 "POW texSamp.a, texSamp.a, params6.w;" + // fog punch through shortcut
1283012839 // mar 2013 ??? "KIL alpha.a;" +
1283112840 "MOV alpha, texSamp.aaaa;" + // y;" +
12832
- "KIL alpha.a;" +
12841
+ "KIL alpha.a;" + // not sure with parallax mapping
1283312842 /*
1283412843 "MUL temp.xy, temp, two;" +
1283512844 "TXB bump, temp, texture[0], 2D;" +
....@@ -12915,11 +12924,6 @@
1291512924 "SUB bump0, bump0, half;" +
1291612925 "ADD bump, bump, bump0;" +
1291712926
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
-
1292312927 // double-sided
1292412928 /**/
1292512929 (doublesided?"DP3 temp.z, normal, eye;" +
....@@ -12949,6 +12953,41 @@
1294912953 Normalize("U") +
1295012954
1295112955 // 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;" +
1295212991
1295312992 //"MOV temp, fragment.texcoord[0];" +
1295412993 //
....@@ -13730,7 +13769,7 @@
1373013769 /*static*/ float[] modelParams4 = new float[]{0, 0, 0, 0}; // anisoV, cameralight, selfshadow, shadow
1373113770 /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias
1373213771 /*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
1373413773
1373513774 //Object3D.cVector2[] vector2buffer;
1373613775
....@@ -15282,8 +15321,8 @@
1528215321 case 'K':
1528315322 KOMPACTTEXTURE ^= true;
1528415323 //textures.clear();
15285
- break;
15286
- case 'P': // Texture Projection macros
15324
+ // break;
15325
+ //case 'P': // Texture Projection macros
1528715326 // SAVETEXTURE ^= true;
1528815327 macromode = true;
1528915328 Udebug = Vdebug = NORMALdebug = false; programInitialized = false;
....@@ -15404,7 +15443,7 @@
1540415443 targetLookAt.set(manipCamera.lookAt);
1540515444 repaint();
1540615445 break;
15407
- case 'p':
15446
+ case 'P': // p':
1540815447 // c'est quoi ca au juste? spherical ^= true;
1540915448 Skinshader ^= true; programInitialized = false;
1541015449 repaint();