The Nodal Scene Interface (NSI) is a simple yet expressive API to describe a scene to a renderer. From geometry declaration, to instancing, to attribute inheritance and shader assignments, everything fits in 12 API calls. The following subsection demonstrate how to achieve most common manipulations.
Geometry Creation
Creating geometry nodes is simple. The content of each node is filled using the NSISetAttribute
call.
...
Code Block | ||||
---|---|---|---|---|
| ||||
/** Turn our mesh into a subdivision surface */ nsi.SetAttribute( "simple polygon", NSI::CStringPArg("subdivision.scheme", "catmull-clark") ); |
Creating and Assigning Shaders
Shaders are created as any other nodes using the NSICreate API call. They are not assigned directly on geometry but through an intermediate attributes nodes. Having an extra indirection allows for more flexible export as we will see in the following chapters.
...