[Bf-cycles] Procedure for adding a new node/shader type

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Mar 30 16:21:43 CEST 2012


Hi,

Adding nodes requires changes to quite a few files, this is one of the
most messy parts of the code because it requires changes all the way
from blender to the kernel. But basically I'd suggest to find an
existing node and search for its name through the code, to see all the
places where it needs to be inserted. You could also look at a commit
that added a new node, like this one:
http://lists.blender.org/pipermail/bf-blender-cvs/2012-January/042432.html

Brecht.

On Thu, Mar 29, 2012 at 3:57 AM, Nikhilesh Sigatapu
<s.nikhilesh at gmail.com> wrote:
> Hello!
>
> I've been studying the cycles code for a while recently, and find myself
> quite interested in it since it seems, to me, to be rather neat and well
> written for the most part. It also has a small codebase at this early
> stage, which makes the structure easier to understand.
>
> I was wondering about how one would go about adding a new node type to
> cycles, say, a subsurface scattering node type, to represent the
> interface to a new internal shader type. It seems that there are a bunch
> of flags across multiple source files.
>
> Does one simply have to add the new node type in render/nodes.{h,cpp},
> write the corresponding kernel shader function, add to the switch
> statement in svm_eval_nodes to handle the new type, and accumulate into
> the respective pass?
>
> --
> Nikhilesh S
> http://www.nikhilesh.info
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles


More information about the Bf-cycles mailing list