natiny.shader.load

Lua
local shader = natiny.shader.load(nsl_source)

Compiles an NSL resource containing vertex and fragment stages for the active graphics backend.

Parameters

Name Type Description
nsl_source number Resource holding the .nsl source

Returns

Type Description
number Shader handle, or an error when the source does not compile

Example

Lua
local shader = natiny.shader.load(source)

Notes

  • A successfully initialized backend and graphics device are required.
  • Compilation or backend rejection prints diagnostics and raises a Lua error.
  • The source bytes are consumed during the call; the source resource is not retained and may be destroyed afterwards.