Constructor
(abstract) new Light(maxDirs)
- Source:
Constructor.
Parameters:
Name | Type | Description |
---|---|---|
maxDirs |
number | the maximum number of directions computed for this light. |
Classes
Members
isGlobal :boolean
- Source:
Says whether the shape is global. True if global, false otherwise.
Type:
- boolean
isLight :boolean
- Source:
Says that the object inherits from Light
Type:
- boolean
isLocal :boolean
- Source:
Says whether the shape is local. True if local, false otherwise
Type:
- boolean
maxDirs :number
- Source:
Maximum number of directions computed for this light.
Type:
- number
Methods
(abstract) glslDirections() → {string}
- Source:
Return the chunk of GLSL code corresponding to the direction field.
The GLSL direction function should have the following signature
bool {{name}}_directions(RelVector v, int i, out RelVector dir, out float intensity)
where
v
gives the position at which we compute the directioni
means that we are computed the i-th direction (the index start at i = 0) The function returns true if the i-th direction exists and false otherwise. If the i-th direction exists, then it populates dir with the direction and intensity with the light intensity (in this direction).
Returns:
- Type
- string
glslInstance() → {string}
- Source:
Compile all the function directly related to the object (e.g. direction field).
Returns:
- Type
- string