Normand Briere
2019-08-17 ecc1309a04b527c62ffe97e814daf050dbd025cd
Skin shader + material panel fix.
3 files modified
36 ■■■■ changed files
CameraPane.java 17 ●●●● patch | view | raw | blame | history
GroupEditor.java 2 ●●●●● patch | view | raw | blame | history
ObjEditor.java 17 ●●●●● patch | view | raw | blame | history
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;
....@@ -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(0);
10703
+ }
10704
+
1069610705 if (Grafreed.savesound && Grafreed.hassound)
1069710706 {
1069810707 Grafreed.wav.save();
....@@ -15282,8 +15291,8 @@
1528215291 case 'K':
1528315292 KOMPACTTEXTURE ^= true;
1528415293 //textures.clear();
15285
- break;
15286
- case 'P': // Texture Projection macros
15294
+ // break;
15295
+ //case 'P': // Texture Projection macros
1528715296 // SAVETEXTURE ^= true;
1528815297 macromode = true;
1528915298 Udebug = Vdebug = NORMALdebug = false; programInitialized = false;
....@@ -15404,7 +15413,7 @@
1540415413 targetLookAt.set(manipCamera.lookAt);
1540515414 repaint();
1540615415 break;
15407
- case 'p':
15416
+ case 'P': // p':
1540815417 // c'est quoi ca au juste? spherical ^= true;
1540915418 Skinshader ^= true; programInitialized = false;
1541015419 repaint();
GroupEditor.java
....@@ -1259,6 +1259,8 @@
12591259
12601260 CreateTexturePanel(textures);
12611261
1262
+ resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1263
+
12621264 oe.toolboxPanel.add(textures);
12631265
12641266 textures.preferredHeight = 100;
ObjEditor.java
....@@ -426,6 +426,9 @@
426426
427427 static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
428428
429
+ // This is to refresh the UI of the material panel.
430
+ boolean patchMaterial;
431
+
429432 void SetupMenu()
430433 {
431434 frame.setMenuBar(menuBar = new MenuBar());
....@@ -1689,6 +1692,10 @@
16891692 objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
16901693 objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
16911694
1695
+ patchMaterial = true;
1696
+ cameraView.patchMaterial = this;
1697
+ objectPanel.setSelectedIndex(1);
1698
+
16921699 /*
16931700 aConstraints.gridx = 0;
16941701 aConstraints.gridwidth = 1;
....@@ -1886,7 +1893,15 @@
18861893
18871894 // Skin
18881895 colorField.setFloat(material.color);
1889
- saturationField.setFloat(material.modulation);
1896
+ float saturation = material.modulation;
1897
+
1898
+ if (!cameraView.Skinshader)
1899
+ {
1900
+ saturation /= 1.5;
1901
+ }
1902
+
1903
+ saturationField.setFloat(saturation);
1904
+
18901905 subsurfaceField.setFloat(material.subsurface);
18911906 selfshadowField.setFloat(material.diffuseness);
18921907 diffusenessField.setFloat(material.factor);