Normand Briere
2018-07-03 02e145cb923d601395acc7f15ae9e13f85ef2fbb
CameraPane.java
....@@ -2000,10 +2000,12 @@
20002000 */
20012001 TextureData ReduceTexture(TextureData texturedata, int resolution) // String name)
20022002 {
2003
+ int pixelformat = texturedata.getPixelFormat();
2004
+
20032005 int stride = 1;
2004
- if (texturedata.getPixelFormat() == GetGL().GL_RGB || texturedata.getPixelFormat() == GetGL().GL_BGR) // || texturedata.getPixelFormat() == GL.GL_LUMINANCE)
2006
+ if (pixelformat == GetGL().GL_RGB || pixelformat == GetGL().GL_BGR) // || texturedata.getPixelFormat() == GL.GL_LUMINANCE)
20052007 stride = 3;
2006
- if (texturedata.getPixelFormat() == GetGL().GL_RGBA || texturedata.getPixelFormat() == GetGL().GL_BGRA) // || texturedata.getPixelFormat() == GL.GL_LUMINANCE_ALPHA)
2008
+ if (pixelformat == GetGL().GL_RGBA || pixelformat == GetGL().GL_BGRA) // || texturedata.getPixelFormat() == GL.GL_LUMINANCE_ALPHA)
20072009 stride = 4;
20082010
20092011 int width = texturedata.getWidth();
....@@ -7590,7 +7592,8 @@
75907592
75917593 float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
75927594 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
7593
- float[] options3 = new float[]{1, 1, 1, 1}; // fog color. image intensity
7595
+ float[] options3 = new float[]{1, 1, 1, 0}; // fog color
7596
+ float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
75947597
75957598 static int imagecount = 0; // movie generation
75967599
....@@ -7690,7 +7693,7 @@
76907693
76917694 if (renderCamera != lightCamera)
76927695 for (int count = parentcam.GetTransformCount(); --count>=0;)
7693
- LA.matConcat(parentcam.toParent, matrix, matrix);
7696
+ LA.matConcat(matrix, parentcam.toParent, matrix);
76947697
76957698 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
76967699
....@@ -7706,7 +7709,7 @@
77067709
77077710 if (renderCamera != lightCamera)
77087711 for (int count = parentcam.GetTransformCount(); --count>=0;)
7709
- LA.matConcat(matrix, parentcam.fromParent, matrix);
7712
+ LA.matConcat(parentcam.fromParent, matrix, matrix);
77107713
77117714 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
77127715
....@@ -7923,7 +7926,7 @@
79237926
79247927 if (!BOXMODE)
79257928 {
7926
- System.out.println("image: " + fullname + " (" + (GrafreeD.wav.cursor / 735 / 4) + ")");
7929
+ System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")");
79277930 }
79287931
79297932 if (!BOXMODE)
....@@ -8784,7 +8787,7 @@
87848787 if (!IsFrozen())
87858788 {
87868789 // dec 2012
8787
- if (!(!flash && !lightMode && drawMode == DEFAULT && ANTIALIAS > 0))
8790
+ if (!ambientOcclusion && !(!flash && !lightMode && drawMode == DEFAULT && ANTIALIAS > 0))
87888791 {
87898792 framecount++;
87908793 shadowbuffer.display();
....@@ -8912,7 +8915,7 @@
89128915 // if (parentcam != renderCamera) // not a light
89138916 if (cam != lightCamera)
89148917 for (int count = parentcam.GetTransformCount(); --count>=0;)
8915
- LA.matConcat(parentcam.toParent, matrix, matrix);
8918
+ LA.matConcat(matrix, parentcam.toParent, matrix);
89168919
89178920 for (int j = 0; j < 4; j++)
89188921 {
....@@ -8927,7 +8930,7 @@
89278930 // if (parentcam != renderCamera) // not a light
89288931 if (cam != lightCamera)
89298932 for (int count = parentcam.GetTransformCount(); --count>=0;)
8930
- LA.matConcat(matrix, parentcam.fromParent, matrix);
8933
+ LA.matConcat(parentcam.fromParent, matrix, matrix);
89318934
89328935 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
89338936
....@@ -9379,6 +9382,7 @@
93799382
93809383 gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 63, options2, 0);
93819384 gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 62, options3, 0);
9385
+ gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 61, options4, 0);
93829386
93839387 options2[0] *= renderCamera.Distance();
93849388
....@@ -9750,7 +9754,7 @@
97509754 selectedpoint.radius = radius;
97519755 selectedpoint.recalculate();
97529756 selectedpoint.material = new cMaterial();
9753
- selectedpoint.material.color = 0.25f;
9757
+ selectedpoint.material.color = 0.15f;
97549758 selectedpoint.material.modulation = 0.75f;
97559759
97569760 debugpoint.radius = radius;
....@@ -10357,11 +10361,13 @@
1035710361 "PARAM params6 = program.env[6];" + // bump, noise, borderfade, fog punchthrough
1035810362 "PARAM params7 = program.env[7];" + // noise power, opacity power
1035910363 "PARAM options0 = program.env[63];" + // fog density, intensity, elevation
10360
- "PARAM options1 = program.env[62];" + // fog rgb color, image intensity
10364
+ "PARAM options1 = program.env[62];" + // fog rgb color
10365
+ "PARAM options2 = program.env[61];" + // image intensity, subsurface, lightsheen
1036110366 "PARAM pointlight = program.env[127];" + // ...
1036210367 "PARAM zero = { 0.0, 0.0, 0.0, 0.0 };" +
1036310368 "PARAM halfhalf = { 0.25, 0.25, 0.25, 1.0 };" +
1036410369 "PARAM half = { 0.5, 0.5, 0.5, 1.0 };" +
10370
+ "PARAM threequarter = { 0.75, 0.75, 0.75, 1.0 };" +
1036510371 "PARAM two = { 2.0, 2.0, 2.0, 1.0 };" +
1036610372 "PARAM ten = { 10, 10, 10, 1.0 };" +
1036710373 "PARAM one3rd = { 0.5, 0.33333333333, 0.333333333, 1.0 };" +
....@@ -10422,6 +10428,10 @@
1042210428 "TEMP R1;" +
1042310429 "TEMP R2;" +
1042410430 "TEMP R3;" +
10431
+ "TEMP min;" +
10432
+ "TEMP max;" +
10433
+ "TEMP average;" +
10434
+ "TEMP saturation;" +
1042510435 "TEMP keep1;" +
1042610436 "TEMP keep2;" +
1042710437 "TEMP keep3;" +
....@@ -10952,10 +10962,40 @@
1095210962
1095310963 // skin?
1095410964 // Saturation for skin
10955
- /**/ // c'est ici
10956
- (Skinshader? "DP3 temp.x, final,one;" +
10965
+ /**/
10966
+ (Skinshader?
10967
+ "DP3 average.x, final,one;" +
10968
+ "MUL average, one3rd.xxxx,average.xxxx;" +
10969
+
10970
+ "MIN min.x, final.x,final.y;" +
10971
+ "MIN min.x, min.x,final.z;" +
10972
+
10973
+ "MAX max.x, final.x,final.y;" +
10974
+ "MAX max.x, max.x,final.z;" +
10975
+ "MOV max, max.xxxx;" +
10976
+
10977
+ "SUB saturation, max, final;" +
10978
+
10979
+ "ADD temp.x, max.x, one10th.x;" +
10980
+ "RCP temp.x, temp.x;" +
10981
+ "MUL temp.x, temp.x, half.x;" +
10982
+ "MUL saturation, saturation, temp.xxxx;" +
10983
+
10984
+ "DP3 ndotl.x, normald, light;" +
10985
+ "MAX ndotl.x, ndotl.x, -ndotl.x;" +
10986
+
10987
+ "SUB temp.x, one.x, ndotl.x;" +
10988
+ "ADD temp.x, temp.x, options2.z;" + // lightsheen
10989
+ "ADD temp.y, one.y, options2.y;" + // sursurface
10990
+ "MUL temp.x, temp.x, temp.y;" +
10991
+
10992
+ "MUL saturation, saturation, temp.xxxx;" +
10993
+ "SUB_SAT temp, max, saturation;" +
10994
+/**
10995
+ "DP3 temp.x, final,one;" +
1095710996 "MUL R2, one3rd.xxxx,temp.xxxx;" +
10958
- "SUB temp, final,R2;" +
10997
+ "SUB temp, final, R2;" +
10998
+
1095910999 // using light angle
1096011000 "DP3 ndotl.x, normald,light;" +
1096111001 //"SLT ndotl.y, ndotl.x, zero.x;" +
....@@ -10968,7 +11008,6 @@
1096811008 // using light intensity
1096911009 "MOV ndotl.z, R2.x;" +
1097011010 "MUL ndotl.z, ndotl.z, ndotl.z;" + // tuning...
10971
-
1097211011 // june 2014
1097311012 "MAD R1.x, ndotl.z,slope.y,one.x;" +
1097411013 // "SUB ndotl.x, one.x, ndotl.x;" +
....@@ -10980,6 +11019,7 @@
1098011019 //"MUL R2.y, shadow.x,R2.y;" + // avril 2014
1098111020
1098211021 "MAD temp.x, R2.y, ndotl.y, temp.x;" + // red shift (skin)
11022
+/**/
1098311023
1098411024 // "ADD final, R2,temp;" +
1098511025 "MOV final, temp;"
....@@ -11069,7 +11109,7 @@
1106911109 /**/
1107011110 // HDR
1107111111 "MOV temp.z, final.a;" +
11072
- "MUL final, final,options1.w;" +
11112
+ "MUL final, final,options2.x;" +
1107311113 "MOV final.a, temp.z;" +
1107411114 /**/
1107511115
....@@ -12814,7 +12854,9 @@
1281412854 {
1281512855 mouseMode |= ZOOM;
1281612856 }
12817
- if ((modifiers & META) == META)
12857
+
12858
+ boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
12859
+ if (capsLocked || (modifiers & META) == META)
1281812860 {
1281912861 mouseMode |= VR; // BACKFORTH;
1282012862 }
....@@ -12828,6 +12870,7 @@
1282812870 }
1282912871 if ((modifiers & SHIFT) == SHIFT || forcetranslate)
1283012872 {
12873
+ mouseMode &= ~VR;
1283112874 mouseMode |= TRANSLATE;
1283212875 }
1283312876 // if ((modifiers & SHIFT_META) == SHIFT_META)
....@@ -13217,7 +13260,8 @@
1321713260 FlipTransform();
1321813261 break;
1321913262 case ENTER:
13220
- object.editWindow.ScreenFit(); // Edit();
13263
+ // object.editWindow.ScreenFit(); // Edit();
13264
+ ToggleLive();
1322113265 break;
1322213266 case DELETE:
1322313267 ClearSelection();
....@@ -14678,6 +14722,11 @@
1467814722 // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]);
1467914723 // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]);
1468014724
14725
+ // Will fit the mesh !!!
14726
+ selectedpoint.toParent[0][0] = 0.0001;
14727
+ selectedpoint.toParent[1][1] = 0.0001;
14728
+ selectedpoint.toParent[2][2] = 0.0001;
14729
+
1468114730 glu.gluUnProject(x,y,depth,view,0,tempmat2,0,viewport,0,selectedpoint.toParent[3],0);
1468214731
1468314732 // if (object.selection != null && object.selection.Size() > 0)
....@@ -15300,7 +15349,7 @@
1530015349 int AAbuffersize = 0;
1530115350
1530215351 //double[] selectedpoint = new double[3];
15303
- static Sphere selectedpoint = new Sphere();
15352
+ static Superellipsoid selectedpoint = new Superellipsoid();
1530415353 static Sphere previousselectedpoint = null;
1530515354 static Sphere debugpoint = new Sphere();
1530615355 static Sphere debugpoint2 = new Sphere();