Solid

Solid

Abstract class for solids. Unlike shapes, materials or lights, solids have no existence as a structure on the shader side. This comes from the fact that the type of shape / material may vary. As a consequence, solids do not have a numerical ID, just a UUID.

Constructor

new Solid(shape, material, ptMaterial)

Source:
Parameters:
Name Type Description
shape Shape

the shape of the solid

material Material

the material of the solid

ptMaterial PTMaterial

material for path tracing (optional)

Classes

Solid

Members

isRendered

Source:

Says whether the solid should be rendered or not. The property can be used to define solids that will appear later in the scene (because of some animation, game event, etc) without having to rebuild the shader. Default is true.

isSolid :boolean

Source:

Say if the item is a solid

Type:
  • boolean

material :Material

Source:

The material of the solid

Type:

ptMaterial :PTMaterial

Source:

The material of the solid for path tracing

Type:

shape :Shape

Source:

The shape of the solids

Type:

Methods

glslInstance() → {string}

Source:

Return a chunk of GLSL code used to compute the color of the solid. This computation may involve normal and/or UV coordinates. This is automatically determined from the properties of the material.

Returns:
Type
string

onAdd(scene)

Source:

Additional actions to perform when the object is added to the scene. By default, propagate the call.

Parameters:
Name Type Description
scene Scene

the scene to which the object is added.

setId(scene)

Source:

Set the ID of the shape. Propagate the process if needed.

Parameters:
Name Type Description
scene Scene

the scene to which the object is added.

updateData()

Source:

Update the data of the underlying shape. It should also update the data of all itd children.