Module ncine.shaderstate

The table containing shader state related functions

Functions

ncine.shaderstate.new (node, shader) Constructs a shaderstate object and assigns to it a node and a shader.
ncine.shaderstate.delete (shaderstate) Destroys a shaderstate object and releases its memory
ncine.shaderstate.get_node (shaderstate) Returns the drawable node affected by the shader state
ncine.shaderstate.set_node (shaderstate, node) Sets the drawable node affected by the shader state
ncine.shaderstate.get_shader (shaderstate) Return the associated custom shader
ncine.shaderstate.set_shader (shaderstate, shader) Sets the associated custom shader
ncine.shaderstate.reset_shader (shaderstate) Triggers a shader update without setting a new shader
ncine.shaderstate.set_texture (shaderstate, unit, texture) Assigns a texture to the specified texture unit
ncine.shaderstate.set_uniform_int_vector (shaderstate, block_name, name, vector) Sets an integer uniform with an array of values
ncine.shaderstate.set_uniform_int_value1 (shaderstate, block_name, name, value0) Sets an integer uniform with one value
ncine.shaderstate.set_uniform_int_value2 (shaderstate, block_name, name, value0, value1) Sets an integer uniform with two values
ncine.shaderstate.set_uniform_int_value3 (shaderstate, block_name, name, value0, value1, value2) Sets an integer uniform with three values
ncine.shaderstate.set_uniform_int_value4 (shaderstate, block_name, name, value0, value1, value2, value3) Sets an integer uniform with four values
ncine.shaderstate.set_uniform_int_vector2 (shaderstate, block_name, name, vector) Sets an integer uniform with a ncine.vec2
ncine.shaderstate.set_uniform_int_vector3 (shaderstate, block_name, name, vector) Sets an integer uniform with a ncine.vec3
ncine.shaderstate.set_uniform_int_vector4 (shaderstate, block_name, name, vector) Sets an integer uniform with a ncine.vec4
ncine.shaderstate.set_uniform_float_vector (shaderstate, block_name, name, vector) Sets a float uniform with an array of values
ncine.shaderstate.set_uniform_float_value1 (shaderstate, block_name, name, value0) Sets a float uniform with one value
ncine.shaderstate.set_uniform_float_value2 (shaderstate, block_name, name, value0, value1) Sets a float uniform with two values
ncine.shaderstate.set_uniform_float_value3 (shaderstate, block_name, name, value0, value1, value2) Sets a float uniform with three values
ncine.shaderstate.set_uniform_float_value4 (shaderstate, block_name, name, value0, value1, value2, value3) Sets a float uniform with four values
ncine.shaderstate.set_uniform_float_vector2 (shaderstate, block_name, name, vector) Sets a float uniform with a ncine.vec2
ncine.shaderstate.set_uniform_float_vector3 (shaderstate, block_name, name, vector) Sets a float uniform with a ncine.vec3
ncine.shaderstate.set_uniform_float_vector4 (shaderstate, block_name, name, vector) Sets a float uniform with a ncine.vec4
ncine.shaderstate.set_uniform_float_color (shaderstate, block_name, name, color) Sets a float uniform with a ncine.color

Tables

shaderstateObj The light user data of a shaderstate object


Functions

ncine.shaderstate.new (node, shader)
Constructs a shaderstate object and assigns to it a node and a shader.

Don’t forget to call delete when you are done with it!

Parameters:

Returns:

    shaderstateObj A new shader object
ncine.shaderstate.delete (shaderstate)
Destroys a shaderstate object and releases its memory

Parameters:

ncine.shaderstate.get_node (shaderstate)
Returns the drawable node affected by the shader state

Parameters:

Returns:

    ncine.drawable_node.drawablenodeObj or nil
ncine.shaderstate.set_node (shaderstate, node)
Sets the drawable node affected by the shader state

Parameters:

  • shaderstate shaderstateObj
  • node ncine.drawable_node.drawablenodeObj or nil

Returns:

    boolean True if the node has been changed
ncine.shaderstate.get_shader (shaderstate)
Return the associated custom shader

Parameters:

Returns:

    ncine.shader.shaderObj or nil
ncine.shaderstate.set_shader (shaderstate, shader)
Sets the associated custom shader

Parameters:

Returns:

    boolean True if the shader has been changed
ncine.shaderstate.reset_shader (shaderstate)
Triggers a shader update without setting a new shader

Parameters:

ncine.shaderstate.set_texture (shaderstate, unit, texture)
Assigns a texture to the specified texture unit

Parameters:

Returns:

    boolean True if the texture has been assigned
ncine.shaderstate.set_uniform_int_vector (shaderstate, block_name, name, vector)
Sets an integer uniform with an array of values

Parameters:

  • shaderstate shaderstateObj
  • block_name string It can be an empty string
  • name string Uniform name
  • vector integer[] An array of 1 to 4 integer elements

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_int_value1 (shaderstate, block_name, name, value0)
Sets an integer uniform with one value

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_int_value2 (shaderstate, block_name, name, value0, value1)
Sets an integer uniform with two values

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_int_value3 (shaderstate, block_name, name, value0, value1, value2)
Sets an integer uniform with three values

Parameters:

  • shaderstate shaderstateObj
  • block_name string It can be an empty string
  • name string Uniform name
  • value0 integer
  • value1 integer
  • value2 integer

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_int_value4 (shaderstate, block_name, name, value0, value1, value2, value3)
Sets an integer uniform with four values

Parameters:

  • shaderstate shaderstateObj
  • block_name string It can be an empty string
  • name string Uniform name
  • value0 integer
  • value1 integer
  • value2 integer
  • value3 integer

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_int_vector2 (shaderstate, block_name, name, vector)
Sets an integer uniform with a ncine.vec2

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_int_vector3 (shaderstate, block_name, name, vector)
Sets an integer uniform with a ncine.vec3

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_int_vector4 (shaderstate, block_name, name, vector)
Sets an integer uniform with a ncine.vec4

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_vector (shaderstate, block_name, name, vector)
Sets a float uniform with an array of values

Parameters:

  • shaderstate shaderstateObj
  • block_name string It can be an empty string
  • name string Uniform name
  • vector number[] An array of 1 to 4 float elements

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_value1 (shaderstate, block_name, name, value0)
Sets a float uniform with one value

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_value2 (shaderstate, block_name, name, value0, value1)
Sets a float uniform with two values

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_value3 (shaderstate, block_name, name, value0, value1, value2)
Sets a float uniform with three values

Parameters:

  • shaderstate shaderstateObj
  • block_name string It can be an empty string
  • name string Uniform name
  • value0 number
  • value1 number
  • value2 number

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_value4 (shaderstate, block_name, name, value0, value1, value2, value3)
Sets a float uniform with four values

Parameters:

  • shaderstate shaderstateObj
  • block_name string It can be an empty string
  • name string Uniform name
  • value0 number
  • value1 number
  • value2 number
  • value3 number

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_vector2 (shaderstate, block_name, name, vector)
Sets a float uniform with a ncine.vec2

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_vector3 (shaderstate, block_name, name, vector)
Sets a float uniform with a ncine.vec3

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_vector4 (shaderstate, block_name, name, vector)
Sets a float uniform with a ncine.vec4

Parameters:

Returns:

    boolean True if the uniform has been found and updated
ncine.shaderstate.set_uniform_float_color (shaderstate, block_name, name, color)
Sets a float uniform with a ncine.color

Parameters:

Returns:

    boolean True if the uniform has been found and updated

Tables

shaderstateObj
The light user data of a shaderstate object
generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56