| .. | .. | 
|---|
| 66 | 66 |               */ | 
|---|
| 67 | 67 |              super.SetupUI2(oe); | 
|---|
| 68 | 68 |                   | 
|---|
| 69 |  | -            uDivsField = AddSlider(oe.ctrlPanel, "U #", biparam.minUDivs, 1024+biparam.minUDivs, biparam.uDivs);  | 
|---|
 | 69 | +            uDivsField = AddSlider(oe.ctrlPanel, "U #", biparam.minUDivs, 250+biparam.minUDivs, biparam.uDivs);  | 
|---|
| 70 | 70 |              Return(); | 
|---|
| 71 |  | -            vDivsField = AddSlider(oe.ctrlPanel, "V #", biparam.minVDivs, 1024+biparam.minVDivs, biparam.vDivs);  | 
|---|
 | 71 | +            vDivsField = AddSlider(oe.ctrlPanel, "V #", biparam.minVDivs, (int)(250/6.28)+biparam.minVDivs, biparam.vDivs);  | 
|---|
| 72 | 72 |              Return(); | 
|---|
| 73 | 73 |  //		oe.aConstraints.gridwidth = 1; | 
|---|
| 74 | 74 |  //		oe.aConstraints.fill = GridBagConstraints.VERTICAL; | 
|---|
 
| .. | .. | 
|---|
| 2163 | 2163 |               //   if (slow) | 
|---|
| 2164 | 2164 |      // aout 2013 | 
|---|
| 2165 | 2165 |                  // sept 2013 merde... | 
|---|
| 2166 |  | -                W = 13;  | 
|---|
 | 2166 | +                W = 3; // 13;  | 
|---|
| 2167 | 2167 |   | 
|---|
| 2168 | 2168 |             // POSERATE | 
|---|
| 2169 | 2169 |                      if (CameraPane.tickcount > 0 || CameraPane.SLOWPOSE) | 
|---|
 
| .. | .. | 
|---|
| 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 |       | 
|---|
| .. | .. | 
|---|
| 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 |                   | 
|---|
 
| .. | .. | 
|---|
| 285 | 285 |  		genNormalsORGANItem.addActionListener(this); | 
|---|
| 286 | 286 |  		genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); | 
|---|
| 287 | 287 |  		genNormalsCADItem.addActionListener(this); | 
|---|
 | 288 | +		genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));  | 
|---|
 | 289 | +		genNormalsMESHItem.addActionListener(this);  | 
|---|
| 288 | 290 |  		stripifyItem = menu.add(new MenuItem("Stripify")); | 
|---|
| 289 | 291 |  		stripifyItem.addActionListener(this); | 
|---|
| 290 | 292 |  		unstripifyItem = menu.add(new MenuItem("Unstripify")); | 
|---|
| .. | .. | 
|---|
| 2308 | 2310 |  		if (event.getSource() == genNormalsCADItem) | 
|---|
| 2309 | 2311 |                  { | 
|---|
| 2310 | 2312 |  			GenNormals(true); | 
|---|
 | 2313 | +		} else  | 
|---|
 | 2314 | +		if (event.getSource() == genNormalsMESHItem)  | 
|---|
 | 2315 | +                {  | 
|---|
 | 2316 | +			GenNormals(true); // TODO  | 
|---|
| 2311 | 2317 |  		} else | 
|---|
| 2312 | 2318 |  		if (event.getSource() == genNormalsORGANItem) | 
|---|
| 2313 | 2319 |                  { | 
|---|
| .. | .. | 
|---|
| 4845 | 4851 |  	private MenuItem clearItem; | 
|---|
| 4846 | 4852 |  	private MenuItem clearAllItem; | 
|---|
| 4847 | 4853 |  	private MenuItem genUVItem; | 
|---|
 | 4854 | +	private MenuItem genNormalsMESHItem;  | 
|---|
| 4848 | 4855 |  	private MenuItem genNormalsCADItem; | 
|---|
| 4849 | 4856 |  	private MenuItem genNormalsORGANItem; | 
|---|
| 4850 | 4857 |  	private MenuItem stripifyItem; | 
|---|
 
| .. | .. | 
|---|
| 5519 | 5519 |                      display.options2[2] = material.factor; | 
|---|
| 5520 | 5520 |   | 
|---|
| 5521 | 5521 |                      cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3); | 
|---|
| 5522 |  | -                    display.options3[3] = material.cameralight/0.2f;  | 
|---|
 | 5522 | +                    display.options4[0] = material.cameralight/0.2f;  | 
|---|
 | 5523 | +                    display.options4[1] = material.subsurface;  | 
|---|
 | 5524 | +                    display.options4[2] = material.sheen;  | 
|---|
| 5523 | 5525 |                       | 
|---|
| 5524 | 5526 |                   //   if (display.CURRENTANTIALIAS > 0) | 
|---|
| 5525 | 5527 |                   //       display.options3[3] /= 4; | 
|---|