.. | .. |
---|
2000 | 2000 | */ |
---|
2001 | 2001 | TextureData ReduceTexture(TextureData texturedata, int resolution) // String name) |
---|
2002 | 2002 | { |
---|
| 2003 | + int pixelformat = texturedata.getPixelFormat(); |
---|
| 2004 | + |
---|
2003 | 2005 | 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) |
---|
2005 | 2007 | 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) |
---|
2007 | 2009 | stride = 4; |
---|
2008 | 2010 | |
---|
2009 | 2011 | int width = texturedata.getWidth(); |
---|
.. | .. |
---|
7590 | 7592 | |
---|
7591 | 7593 | float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
7592 | 7594 | 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 |
---|
7594 | 7597 | |
---|
7595 | 7598 | static int imagecount = 0; // movie generation |
---|
7596 | 7599 | |
---|
.. | .. |
---|
7923 | 7926 | |
---|
7924 | 7927 | if (!BOXMODE) |
---|
7925 | 7928 | { |
---|
7926 | | - System.out.println("image: " + fullname + " (" + (GrafreeD.wav.cursor / 735 / 4) + ")"); |
---|
| 7929 | + System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")"); |
---|
7927 | 7930 | } |
---|
7928 | 7931 | |
---|
7929 | 7932 | if (!BOXMODE) |
---|
.. | .. |
---|
8784 | 8787 | if (!IsFrozen()) |
---|
8785 | 8788 | { |
---|
8786 | 8789 | // dec 2012 |
---|
8787 | | - if (!(!flash && !lightMode && drawMode == DEFAULT && ANTIALIAS > 0)) |
---|
| 8790 | + if (!ambientOcclusion && !(!flash && !lightMode && drawMode == DEFAULT && ANTIALIAS > 0)) |
---|
8788 | 8791 | { |
---|
8789 | 8792 | framecount++; |
---|
8790 | 8793 | shadowbuffer.display(); |
---|
.. | .. |
---|
9379 | 9382 | |
---|
9380 | 9383 | gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 63, options2, 0); |
---|
9381 | 9384 | gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 62, options3, 0); |
---|
| 9385 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 61, options4, 0); |
---|
9382 | 9386 | |
---|
9383 | 9387 | options2[0] *= renderCamera.Distance(); |
---|
9384 | 9388 | |
---|
.. | .. |
---|
10357 | 10361 | "PARAM params6 = program.env[6];" + // bump, noise, borderfade, fog punchthrough |
---|
10358 | 10362 | "PARAM params7 = program.env[7];" + // noise power, opacity power |
---|
10359 | 10363 | "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 |
---|
10361 | 10366 | "PARAM pointlight = program.env[127];" + // ... |
---|
10362 | 10367 | "PARAM zero = { 0.0, 0.0, 0.0, 0.0 };" + |
---|
10363 | 10368 | "PARAM halfhalf = { 0.25, 0.25, 0.25, 1.0 };" + |
---|
10364 | 10369 | "PARAM half = { 0.5, 0.5, 0.5, 1.0 };" + |
---|
| 10370 | + "PARAM threequarter = { 0.75, 0.75, 0.75, 1.0 };" + |
---|
10365 | 10371 | "PARAM two = { 2.0, 2.0, 2.0, 1.0 };" + |
---|
10366 | 10372 | "PARAM ten = { 10, 10, 10, 1.0 };" + |
---|
10367 | 10373 | "PARAM one3rd = { 0.5, 0.33333333333, 0.333333333, 1.0 };" + |
---|
.. | .. |
---|
10422 | 10428 | "TEMP R1;" + |
---|
10423 | 10429 | "TEMP R2;" + |
---|
10424 | 10430 | "TEMP R3;" + |
---|
| 10431 | + "TEMP min;" + |
---|
| 10432 | + "TEMP max;" + |
---|
| 10433 | + "TEMP average;" + |
---|
| 10434 | + "TEMP saturation;" + |
---|
10425 | 10435 | "TEMP keep1;" + |
---|
10426 | 10436 | "TEMP keep2;" + |
---|
10427 | 10437 | "TEMP keep3;" + |
---|
.. | .. |
---|
10952 | 10962 | |
---|
10953 | 10963 | // skin? |
---|
10954 | 10964 | // 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;" + |
---|
10957 | 10996 | "MUL R2, one3rd.xxxx,temp.xxxx;" + |
---|
10958 | | - "SUB temp, final,R2;" + |
---|
| 10997 | + "SUB temp, final, R2;" + |
---|
| 10998 | + |
---|
10959 | 10999 | // using light angle |
---|
10960 | 11000 | "DP3 ndotl.x, normald,light;" + |
---|
10961 | 11001 | //"SLT ndotl.y, ndotl.x, zero.x;" + |
---|
.. | .. |
---|
10968 | 11008 | // using light intensity |
---|
10969 | 11009 | "MOV ndotl.z, R2.x;" + |
---|
10970 | 11010 | "MUL ndotl.z, ndotl.z, ndotl.z;" + // tuning... |
---|
10971 | | - |
---|
10972 | 11011 | // june 2014 |
---|
10973 | 11012 | "MAD R1.x, ndotl.z,slope.y,one.x;" + |
---|
10974 | 11013 | // "SUB ndotl.x, one.x, ndotl.x;" + |
---|
.. | .. |
---|
10980 | 11019 | //"MUL R2.y, shadow.x,R2.y;" + // avril 2014 |
---|
10981 | 11020 | |
---|
10982 | 11021 | "MAD temp.x, R2.y, ndotl.y, temp.x;" + // red shift (skin) |
---|
| 11022 | +/**/ |
---|
10983 | 11023 | |
---|
10984 | 11024 | // "ADD final, R2,temp;" + |
---|
10985 | 11025 | "MOV final, temp;" |
---|
.. | .. |
---|
11069 | 11109 | /**/ |
---|
11070 | 11110 | // HDR |
---|
11071 | 11111 | "MOV temp.z, final.a;" + |
---|
11072 | | - "MUL final, final,options1.w;" + |
---|
| 11112 | + "MUL final, final,options2.x;" + |
---|
11073 | 11113 | "MOV final.a, temp.z;" + |
---|
11074 | 11114 | /**/ |
---|
11075 | 11115 | |
---|