Normand Briere
2017-05-07 314b34423070cf127464da79a53cddf6b1c38587
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
....@@ -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();
....@@ -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
....@@ -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