Class Environment

An environment is a class that sends information about the current settings of the environment (such as ambient color, fog, light sources, camera transformation matrices) etc to the shader.

Fields

Environment.camera Camera object associated with the current Environment.
Environment.uniform_list UniformList object.
Environment.lights List of light sources.

Methods

Environment:init (camera) The public constructor.
Environment:add_light (uniform_name, light) Add light source.
Environment:send_uniforms_to (shader) Send all the environment uniforms to the shader.
Environment:apply_shader (shader) Set a Shader as current pixel effect or vertex shaders.
Environment:send_light_sources_to (shader) Send light sources uniforms to the shader.


Fields

Environment.camera
Camera object associated with the current Environment.
  • camera (menori.Camera or menori.PerspectiveCamera)
Environment.uniform_list
UniformList object. Uniforms in the list are automatically sent to the shader, which will be used to display objects with this environment.
  • uniform_list menori.UniformList
Environment.lights
List of light sources.

Methods

Environment:init (camera)
The public constructor.

Parameters:

  • camera Camera that will be associated with this environment.
Environment:add_light (uniform_name, light)
Add light source.

Parameters:

  • uniform_name strign Name of uniform used in the shader
  • light menori.UniformList Light source object
Environment:send_uniforms_to (shader)
Send all the environment uniforms to the shader. This function can be used when creating your own display objects, or for shading technique. This method is called automatically when the environment is used in scene:render_nodes()

Parameters:

Environment:apply_shader (shader)
Set a Shader as current pixel effect or vertex shaders. All drawing operations until the next apply will be drawn using the Shader object specified. This method is called automatically when the environment is used in scene:render_nodes()

Parameters:

Environment:send_light_sources_to (shader)
Send light sources uniforms to the shader. This function can be used when creating your own display objects, or for shading technique. This method is called automatically when the environment is used in scene:render_nodes()

Parameters:

generated by LDoc 1.4.6 Last updated 2023-03-21 17:41:24