[][src]Crate nsi

A flexible, modern API for offline 3D renderers

The Nodal Scene Interface (ɴsɪ) is built around the concept of nodes.

Each node has a unique handle to identify it. It also has a type which describes its intended function in the scene.

Nodes are abstract containers for data. The interpretation depends on the node type. Nodes can also be connected to each other to express relationships.

Data is stored on nodes as attributes. Each attribute has a name which is unique on the node and a type which describes the kind of data it holds (strings, integer numbers, floating point numbers, etc).

Relationships and data flow between nodes are represented as connections. Connections have a source and a destination. Both can be either a node or a specific attribute of a node. There are no type restrictions for connections in the interface itself. It is acceptable to connect attributes of different types or even attributes to nodes. The validity of such connections depends on the types of the nodes involved.

What we refer to as the ɴsɪ has two major components:

  1. Methods to create nodes, attributes and their connections. These are attached to a rendering Context.

  2. Nodes of different NodeTypes understood by the renderer.

Much of the complexity and expressiveness of the interface comes from the supported nodes.

The first part was kept deliberately simple to make it easy to support multiple ways of creating nodes.

Features

The 3Delight dynamic library (lib3delight) can either be linked to during build or loaded at runtime. By default the lib is loaded at runtime. This has several advantages:

  1. If you ship your application or library you can ship it without the library. It can still run and will print an informative error if the library cannot be loaded.
  2. A user can install an updated version of the renderer and stuff will ‘just work’.
  • Dynamically link against lib3delight.
    • lib3delight becomes a depdency. If it cannot't be found your lib/app will not load/start.
    • The feature is called link_lib3delight.
  • Download lib3delight during build.
    • lib3delight is downloaded during build. Note that this may be an outdated version. This feature mainly exists for CI purposes.
    • The feature is called download_lib3delight.

Re-exports

pub use crate::argument::*;
pub use crate::context::*;

Modules

argument
context
prelude

Re-exports commonly used types and traits.

Macros

color
colors
double
double_matrices

A macro to create a double precision 4×4 matrix array argument.

double_matrix

A macro to create a double precision 4×4 matrix argument.

doubles
float
floats
integer
integers
matrices
matrix
normal
normals
point
pointer
pointers
points
reference
references
string

A macro to create a string argument.

strings

A macro to create a string array argument.

unsigned
unsigneds
vector
vectors