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

Nikhilesh Sigatapu s.nikhilesh at gmail.com
Thu Mar 29 03:57:21 CEST 2012


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


More information about the Bf-cycles mailing list