Getting MDL code for a material

Is there any way to obtain MDL code for a DzMaterial? My hope is that this is generated at some point in order to feed it to Iray and that I can get a copy of it.

I can see the DzBrickSet has a getFullShaderPath() method, and that returns a path to a .mdl file, but that file doesn't seem to get written at any point as far as I can see.

What I'm hoping to do is to use the MDL code as the basis for translating the shader to another renderer.

Comments

  • There are many .mdl files in the "...DAZStudio4/shaders/iray/" folder. Architectural.mdl, chrome.mdl, pbr_skin.mdl etc. The code of those files is easy to read in notepad (notepad++, wordpad).

  • Those MDL files are part of the picture, but a DzBrickMaterial is, I think, more than that. For example, if you import the PBRSkin material into the shader mixer, you can see it is composed of many bricks, only some of which are Custom MDL bricks which reference the pbr_skin.mdl file. So, my assumption is that there is a compilation process that transforms the entire brick network into some MDL code which is given to Iray. There are some hints of such a thing in the SDK, such as DzBrickSet::getFullShaderPath()DzBrickSetCompilerMgrDzShaderCompilerProcess, but I don't quite see how it all fits together.

  • What a difficult task! I think it's better to experiment with the Genesis(1) material. There are much fewer bricks in the shader mixer and the logic of their relationship is more understandable.

  • MDL Shader Mixer shaders do not get turned into MDL files for Iray, theya re handled via driect calls to the Iray SDK. There is currently no way to export an MDL file.

  • Ah, that was my fear, thank you Richard. Is there a list of the various type of shader brick with technical descriptions of what they do somewhere?

  • Not as such, though I think a lot of them match to the basic Iray MDL definitions

  • I have been told to keep an eye on the change log.

Sign In or Register to comment.