Getting Started

What is Slang

Slang is a shading language backward compatible with HLSL that makes it easier to build and maintain large shader codebases in a modular and extensible fashion, while also maintaining the highest possible performance on modern GPUs and graphics APIs. Slang is based on years of collaboration between researchers at NVIDIA, Carnegie Mellon University, and Stanford.

For better understanding of language usage and features, please refer to the User’s Guide provided by Slang developers.

What is Slang Node

Slang nodes can be placed in all types of OmniGraph. Slang node, when executed, runs a compute Slang function. Node’s input, output, and state attributes define variables that can be referenced in the Slang code. The code of the node’s function can be edited in the Code editor and is saved in the USDA file as a node’s token attribute.

Slang node in a Push Graph with its default inputs and outputs:

Push Graph Node

The current implementation only runs the Slang code single-threaded on the CPU target. Multithreaded and GPU support will be added in future releases.

When should I use Slang Node

The node allows users to write their own functions executed in OmniGraph. Slang code is compiled once during the stage load or on user request in the Code Editor. The node execution does not bring any additional overhead during the OmniGraph updates.

Detail usage of the Slang node is covered in the tutorial How to use Slang node in OmniGraph.

Future work

  1. Multithreading and GPU target support

  2. COM interface support to allow C++ functions callbacks from Slang code

  3. Code editor UX improvements