Announcement

Collapse
No announcement yet.

skin shader a la Alsurface pleaseeee

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #91
    haha I feel your pain, working in maya is often a blind environnement. I really hate doing shading in Maya, working iwth ID's is a pain in the ass and there is no Multi-suboject Mtl, quite a joke.

    It does not work, the error is now : error : indexing into non-array or non-component type.

    Comment


    • #92
      I'll have to look at it when I'm back at work. In the meantime, hopefully someone can comment about the problem with OSL and the VrayBlendMtl in Max.

      Comment


      • #93
        Yeah I hope too

        Comment


        • #94
          sharktacos, BTW, I played again with it this weekend, and the diffuse component work with a single map, but with UDIM, it only use one the of the tile, ( the first one ) ... so... dont's know if you can fix it or if it's a bug in the OSL in max, Vlado, any idea on that?

          Comment


          • #95
            Originally posted by Bigguns View Post
            sharktacos, BTW, I played again with it this weekend, and the diffuse component work with a single map, but with UDIM, it only use one the of the tile, ( the first one ) ... so... dont's know if you can fix it or if it's a bug in the OSL in max, Vlado, any idea on that?

            Weird. It works with muti-region UVs in Maya. Are you using the Vray bitmap variable in the file name where img_<UDIM>.png becomes img_1001.png and so on?

            Comment


            • #96
              This code should work (at least it does in Maya). It does not currently have opacity in it, I can add that in later. The color swatches will default to black, so make sure to put colors them.

              Code:
              /*
               *
               * Wavelength dependent subsurface scattering OSL material by Derek Flood (c)2016
               * Based on the hypershade tree by Tony Reynolds
               * from http://docs.sharktacos.com/misc.php?action=help&hid=66
               *
               */
              
              
              
              
              surface DFskinMtl
                  [[ string description = "blended skin material" ]]
              (
                  /* Global Section */
                  float Depth_Scale = 1,
                  float Overall_Brightness = 1,
               
                  /* SSS Section */
                  string Subsurface_Color = "color.png",
                  float Subsurface_Amount = 1,
                  string RGB_Scatter_Depth = "RGB.png",
                  
                  float Texture_Gamma = 1.0,
               
                  output color result = 1
              )
              
              
              
              {
              
                  /* declare variables and read texture map */   
                  //color Depth = getTextureDif(RGB_Scatter_Depth, color(0.8,0.2,0.1));
                  color Depth = texture(RGB_Scatter_Depth, u, v);
                  
                  Depth = clamp(Depth,0.001,1); // Prevent depth values from being zero which breaks the shader RGB mix
                  //color SubColor = getTextureDif(Subsurface_Color, color(0.85,0.75,0.65));
                  color SubColor = texture(Subsurface_Color, u, v);
                 
                  SubColor = pow(SubColor, Texture_Gamma); //gamma correct texture
                  SubColor *= Overall_Brightness;
                 
                  color SubR = SubColor * color(1,0,0);
                  color SubG = SubColor * color(0,1,0);
                  color SubB = SubColor * color(0,0,1);
                  
              
                 
                  float IOR = 1.38;
                  float PhaseFunction = 0.8;
                  int Subdivs = 8;
               
                 
                  /* Closures */
                  closure color SkinR = vray_subsurface (
                     IOR, PhaseFunction,
                     SubR * Depth[0] * Depth_Scale,
                     SubR * Subsurface_Amount,
                     "subdivs", Subdivs);
                  
                  closure color SkinGB = vray_subsurface (
                     IOR, PhaseFunction,
                     ((SubG * Depth[1]) +
                     (SubB * Depth[2])) * 
                     Depth_Scale,
                     (SubG + SubB) * Subsurface_Amount,
                     "subdivs", Subdivs);
               
                   Ci = (SkinR + SkinGB); 
              
              }

              Comment


              • #97
                It work, but still the same prolbem when I blend it with a vrayblendmtl.. very annoying bug.. can you have a look at it Vlado? and also checking for the UDIM support?


                sharktacos : Can you add a slot to the depth scale, since I like to plug a map here for further control of the sss ? I know I can control it also with the rgb color if I put a texture there, but maybe usefull to have it at the depth factor so I can put a W/B image.
                Last edited by Bigguns; 24-05-2016, 10:51 AM.

                Comment


                • #98
                  Originally posted by Bigguns View Post
                  sharktacos : Can you add a slot to the depth scale, since I like to plug a map here for further control of the sss ? I know I can control it also with the rgb color if I put a texture there, but maybe usefull to have it at the depth factor so I can put a W/B image.
                  I can put that in later possibly, but in the meantime just take two maps, one color and the other black and white, multiply them together, and put the result in the rgb color slot.

                  Comment


                  • #99
                    That latest skin shader work's well when I don't blend it, when blended it's like the other one the texture get fucked up.. but the other one, I was able to blend it with the plugin of blur blend mtl, it was working, but this one not... :S it's really fucked up those .OSL in max, definately many bugs to repairs.. UDIM, Blend Mtl.. It's sad because I love it better then the sss2 ,and meanwhile we get the alsurface equivalent in Vray I would had been albe to use that one

                    Comment


                    • For the UDIM issue, try disabling 'wrap texture coordinates' in the OSL material options.
                      Rens Heeren
                      Generalist
                      WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                      Comment


                      • Hi, it seems to work, but now I cannot even blend it with my blur blend plugin.. it became black... Vlado, can you please have a look at it and find why I can't blend and having the textures showing properly when blended? In maya it work's , should work in max too ... EDIT : while playing with that wrap texture.. max crashed.. there is certainly a nasty bug in there..
                        Last edited by Bigguns; 24-05-2016, 10:19 PM.

                        Comment


                        • A question for Vlado: I've been doing some reading, and was wondering if the ALsurface uses a similar approach to the Quantized-Diffusion BSSRDF model:
                          https://naml.us/~irving/papers/deon2011_subsurface.pdf
                          or perhaps this newer approach, which builds on the above QD approach, but I think is more efficient:
                          http://graphics.pixar.com/library/Ph...sion/paper.pdf

                          My understanding is that these approaches do a better job than the dipole method (which, correct me if I'm wrong, but I think the SSS2 uses) at getting details like between the lips of a person where the dipole can look waxy. I also think they get around the problem of the layered approach which needs to use unintuitive colors so you can just use a "skin color" map and get WYSIWYG artist friendly results (in contrast with the multi-layered approach where each layer tints the next, but similar to the ALsurface which uses a single diffuse map).

                          Finally, would these be things that could be written in OSL, or would they involve coding a new BSSRDF in the Vray SDK?

                          Comment


                          • Click image for larger version

Name:	OSL_skin_test_070.jpg
Views:	1
Size:	123.2 KB
ID:	862186Click image for larger version

Name:	OSL_skin_test_068.jpg
Views:	1
Size:	118.2 KB
ID:	862185Sharktacos ,

                            Here a render comparaison between you'r shader and the very dating sss2 .. remember when I said a small difference between the 2.. it's a huge improvement I meant! it retains much more volumes then the sss2 ... it's wayyy better.. still not as good as the ALsurface, Vlado... it's why we need the alsurface equivalent in Vray.. and soon please.. Corona will get hair and skin shader comparable to Arnold apparently this summer so.. time is running. check this thread.. it has more views then most other thread.. so I think it show the importance of SSS shading capability.

                            EDIT : BTW , both skin has the same color and radius... it give you an idea.. on my character, it look's way better then sss2 ( not that cartoon one but one I'm doing at home ) like the fold of the eyelids are so much better with that skin shader then the sss2.. wayyy better
                            Last edited by Bigguns; 27-05-2016, 04:43 PM.

                            Comment


                            • Originally posted by Bigguns View Post
                              [ATTACH=CONFIG]30473[/ATTACH][ATTACH=CONFIG]30472[/ATTACH]Sharktacos ,

                              Here a render comparaison between you'r shader and the very dating sss2 .. remember when I said a small difference between the 2.. it's a huge improvement I meant! it retains much more volumes then the sss2 ... it's wayyy better.. still not as good as the ALsurface, Vlado... it's why we need the alsurface equivalent in Vray.. and soon please.. Corona will get hair and skin shader comparable to Arnold apparently this summer so.. time is running. check this thread.. it has more views then most other thread.. so I think it show the importance of SSS shading capability.

                              EDIT : BTW , both skin has the same color and radius... it give you an idea.. on my character, it look's way better then sss2 ( not that cartoon one but one I'm doing at home ) like the fold of the eyelids are so much better with that skin shader then the sss2.. wayyy better
                              Cool. One big difference I noticed between the OSL and a VraySkinMtl is tha the OSL does not suffer from the "green" error that appears on thin parts of a model.

                              It would be great to see what the shader looks like on one of your realistic models, like the old guy from ten24 you did with the VraySkinMtl compared with the OSL.

                              Were you able to figure out how to get the OSL to plug into a VrayBlendMtl or a VrayBumpMtl? These both work fine in Maya. Has anyone from Chaos verified that this does not work in Max? I would have thought it would work...

                              Comment


                              • No reply from Vlado here.. I think we can call it dead :/

                                Comment

                                Working...
                                X