Categories

Custom shaders in 3Delight for Maya

Started tinkering with 3Delight again after a long break. One thing that has been bugging me for quite awhile is the inability to combine Hypershade nodes with my own shaders. For some reason the assignment panel doesn’t allow for this.

The main gripe I have with this is that textures don’t show up in the viewport. When doing lookdev or texturing it’s nice to see what you have plugged into the material. Last time I looked at this I ended up assigning a lambert to the object, and then using an override. But that’s a hassle.

There’s a couple of ways this can be done – either through the RSL hypershade node, or by writing a Maya plugin. In this post I’ll go through the plugin. (source can be downloaded at the end of post)

cnode1

Anything plugged into the slots here won’t evaluate as expected.

So starting with the Surface Shader example in the DevKit. This one has Color and Transparency, enough to start out with.

What we need to do is write a corresponding Ri.h file for our custom shader so that 3Delight knows how to translate this node. This .h file contains the inputs, outputs and RSL code to run the shader. For a surface shader this is simple, 2 inputs, 2 outputs and no shading inbetween.

cnode2

Ramp connected to shader. Now we can use all the nodes in the hypershade as normal.

cnode3

And finally the testrender from 3Delight. Pretty cool. I like the extendability of 3Delight. The forums are also extremely helpful and contain much more information that the manual.

Download the source files.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>