iRay Shaders and Materials Links?

I want to learn how to make iRay shaders and materials for DAZ Studio.  Where do I start?  If you could share any links to tutorials or documentation it would be greatly apprciated.  

 

Comments

  • mjc1016mjc1016 Posts: 15,001

    Here's a thread that makes a great start poiint....

    http://www.daz3d.com/forums/discussion/59018/playing-around-with-iray-mdl

  • MaxHancockMaxHancock Posts: 227

    Thanks!  What's the difference between Shader Builder and Shader Mixer? 

  • mjc1016mjc1016 Posts: 15,001
    edited May 2016

    Shader Builder is specificially for creating 3Delight shaders.  Either by importing rsl code or using the bricks, which are rsl code 'block'...specific functions, etc.

    I almost forgot the biggest difference...the final output of ShaderBuilder is a compiled shader...ShaderMixer is a brick network that is compiled at render time.  The advantage of a compiled shader is that it is faster and better optimized.

    Post edited by mjc1016 on
  • ToborTobor Posts: 2,300

    If you're talking about shaders from scratch, you'd do well to study the examplesin the NVIDIA Iray folder, which is added alongside the Iray Uber folder. Both are in C:\Program Files\DAZ 3D\DAZStudio4\shaders\iray\

    There's a big differfence between the shaders in these folders. All of the shaders in the Uber folder (daz_3d\) are based on a single MDL source file, irayubermaterial.mdl, which is extremely complex and fairly hard to reverse engineer for specific uses. The nVidia examples are Daz-ified versions of Iray shader examples published by nVidia. Most (all?) have their own separate MDL source files, and because they are single purpose, are a bit easier to get your head around.

    All this said, what you may instead be interested in is taking the Uber shader, and modifying it for unique materials. You need only adjust the shader parameters in the Surfaces tab, and save those out. This is what nearly everyone, including Daz vendors, does. There is enough flexibility in the Uber shader to support a fairly rich assortment of material types. You don't absolutely need to create your own MDL files.

  • hphoenixhphoenix Posts: 1,335
    edited May 2016
    Tobor said:

    If you're talking about shaders from scratch, you'd do well to study the examplesin the NVIDIA Iray folder, which is added alongside the Iray Uber folder. Both are in C:\Program Files\DAZ 3D\DAZStudio4\shaders\iray\

    There's a big differfence between the shaders in these folders. All of the shaders in the Uber folder (daz_3d\) are based on a single MDL source file, irayubermaterial.mdl, which is extremely complex and fairly hard to reverse engineer for specific uses. The nVidia examples are Daz-ified versions of Iray shader examples published by nVidia. Most (all?) have their own separate MDL source files, and because they are single purpose, are a bit easier to get your head around.

    All this said, what you may instead be interested in is taking the Uber shader, and modifying it for unique materials. You need only adjust the shader parameters in the Surfaces tab, and save those out. This is what nearly everyone, including Daz vendors, does. There is enough flexibility in the Uber shader to support a fairly rich assortment of material types. You don't absolutely need to create your own MDL files.

    This.

     

    However, for special or unusual surfaces, you may be relegated to trying to write your own MDL, or at least using Shader Mixer to put together an MDL shader network to get the results you want.  (A perfect example is one I'm working on.....a realistic soap-bubble shader.  Uses noise functions to perturb the thickness parameter to generate the 'swirling' iridescence, and modulates it based on an 'age' parameter.  It's very complicated to do accurately.)

    Also, some of us are trying to develop shaders that are procedural (like the soap-bubble film shader) so they aren't dependant on texture maps.  That alone saves a lot of graphics RAM and avoids wrapping/edge issues that image maps tend to cause.

    And trust me, it's not easy.  MDL is a shading language.  If you aren't a programmer, and you aren't versed in how physical materials are defined and simulated, it's a lot to learn.

     

    Post edited by hphoenix on
  • MaxHancockMaxHancock Posts: 227
    edited May 2016

    I do have some programming background, so MDL might be something I would be interested in working with. I've worked with brick type of interface to make sounds, so I'm somewhat familure with it, but Shader Mixer and Builder are totally new to me.   

    I have been using the iRay shader base files to make my own textures for some of the projects i'm working on, but one thing I don't understand, and would really need, is to be able to apply texture type of shaders (like the wood and leather texutres) to an object that isn't UVd if that's possible. I'm guessing by the examples, and from the products I've purchase, if a shader has a texture or bump/normal map, then the object it is being applied to must have a UV map to work. But, some of the textures I use though seem to still work on objects that don't have UVs, so I wonder why that is. I guess I'm expecting it to work like 3Dcoat, but that's totally different. 

    Post edited by MaxHancock on
  • ToborTobor Posts: 2,300

    MDL is a quasi declarative/functional language, so if you're just used to just standard procedural languages, it can be a little odd. It also supports assignments, parameters, functions, and other syntax that can take time getting used to. 

    In case it's now burined in the thread provided above, here's a link to the MDL specs and overview:

    http://www.nvidia-arc.com/products/iray/mdl-materials.html

    Note especially the Introduction document, which has a nice section on the programming syntax.

    For UVs, whether a texture works depends on if the object has been mapped, and how. UVs for one surface probably won't work for another, but "won't work" is how the map fits. It should still apply, but it will appear all wrong. For some types of maps and objects, sometimes you can "fake" it by changing the tiles scale and offset.

  • mjc1016mjc1016 Posts: 15,001

    If the item is not UV mapped, then certain things will never work...and tiling is one of them.  But, certain textures could work...if they 'fit'.

Sign In or Register to comment.