How do I use RSL (RenderMan Shading Language) shaders with 3Delight?
![Alley Rat](https://farnsworth-prod.uc.r.appspot.com/forums/uploads/userpics/124/nBBE581FFB415.png)
Hi all,
I'm learning how to make materials in RSL, and would love to be able to use these in my 3Delight renders in DS. Is there an easy way that I've missed? How do I make shader blocks for my custom shaders for the visual shader building? Thanks so much for any help!
SV
Comments
Hi! Not sure what you want to do. AFAIK there are two ways in DS to create a shader, you either compile it in shader mixer or shader builder. They can be found in window/panes(tabs). In the tab you either import a shader from the scene or you create a new one from scratch. You insert the bricks you want to use and connect them. When done, you save as a shader or apply it to a surface in the scene. (This was the very short version). Google shadermixer and shaderbuilder, I'm sure you'll find some useful stuff. Also, there is this thread where the diehard 3DL users hang, 3delight-laboratory-thread-tips-questions-experiments#latest, feel free to post whatever questions about 3DL in there:) If you already knew all this, just ignore me:)
Hi Sven,
Thanks for replying. That gets me most of the way there, but what I'd really like to do is go one level deeper and make my own shader bricks.
Ok, not into coding my self...I suggest you post in the 3DL laboratory thread. There are users here like wowie and Mustakettu85, and a few others, that know these things.
Good luck with your project, we could use some new shaders for 3DL:)
Shader Builder is the tool that has what you need. There isn't a lot of great information / documentation on it though so you're going to find it's a lot of trial and error. When I was working on a custom hair shader (based off Stephen Marschner's work), I was putting a lot of custom code into my own user defined functions. They're easy to add to Shader builder. It's just getting everything to link together properly with inputs parameters and outputs that can be tricky.
There's a custom brick in shader mixer, do you know how to utilize it?
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/interface/panes/shader_builder/start
Rob says "True custom RSL bricks that are not the consumption of Shader Builder (custom macro/function) blocks, require the SDK."
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/intrinsic_types/renderman_shading_language_objects for the non-visual script related objects
Tks Chohole and Rob!
I will say that for most of what I was doing to recreate Marschner's hair shader in 3Delight, the custom functions worked well enough. And I was creating some pretty complex mathematical equations.
I never worked with Shader Mixer. For the way I was thinking about what I was doing, Shader Builder just made more sense to me. It feels to me like it gets to a lower level and since I was recreating RSL, that was a logical place to work from. Shader Builder feels like it is one level abstracted from that, which is probably more comfortable for a lot of people, it just wasn't my "cup of tea."
One suggesting I'd offer to the OP is to spend some time in ShaderBuilder getting used to what you can do natively in the tool. You may find that rather than writing custom RSL code, a LOT of what you want to do can be built with the tools that are already in the builder. I only had a few places where I needed custom functions. Mostly because I was trying to make Marschner's shader, which is written for strand based hair, work on normal transmapped hair products, so I was faking geometry for the shader.
Shader Builder itself is extremely powerful and was one of my favorite new features when it was introduced. If I were to ask for one feature to be added to it, it would have been some sort of a debugger or at least an ability to log some text from within the shader. Basically you kind of end up limited to it either works or crashes. Sometimes it even goes the extra step of crashing Studio for you when your code isn't working well. :)
More advice from Rob
Within Shader Builder, in the Block Repository, right-click the custom User Function/Macro you want to use in Shader Mixer and choose the Export Function/Macro... option. This will produce a .dsx file of your custom block that you can then choose from the option menu of a Shader Builder Block brick within Shader Mixer.
Excellent, thanks:)
Thank you Chohole, Rob, and JonnyRay. I'm finishing up some projects at work this week and will spend some time this weekend with the Shader Builder.