Renderer

Reference

renderer.getWidth()

Get width of the output in pixels

Returns:

width

Return type:

number

renderer.getHeight()

Get height of the output in pixels

Returns:

height

Return type:

number

renderer.setBackgroundShaderUniform(name, value)

Sets a uniform value inside a background shader

Parameters:
  • name (str)

  • value (str)

renderer.raycast(camera, x, y, findAll)

Tests which objects are at the specified pixel position on screen

Parameters:
  • camera (Camera) – the camera to use. If nil, the main camera of the scene will be used. if that does not exist, the first found camera will be used. If no camera exists at all, the function will return nil.

  • x (number) – x position

  • y (number) – y position

  • findAll (boolean) – set to true, to get all objects at the position, otherwise only the first is returned

Returns:

list of intersections with the ray if findAll is true or a single result or nil if nothing was found.

Return type:

table

Examples