Constructor
new CheckerboardMaterial(dir1, dir2, color1, color2)
Constructor
Parameters:
Name | Type | Description |
---|---|---|
dir1 |
Vector2 | first direction of the checkerboard |
dir2 |
Vector2 | second direction of the checkerboard |
color1 |
Color | first color |
color2 |
Color | second color |
Extends
Classes
Members
color1 :Color
first color
Type:
- Color
color2 :Color
second color
Type:
- Color
dir1 :Vector2
first direction of the checkerboard
Type:
- Vector2
dir2 :Vector2
second direction of the checkerboard
Type:
- Vector2
isMaterial :boolean
- Source:
- Overrides:
Says that the object inherits from Material
Type:
- boolean
isReflecting
- Source:
- Overrides:
Says whether the material is reflecting Default is false.
lights
- Source:
- Overrides:
The light eventually affecting the material.
If lights
is not set up when the solid carrying the material is added to the scene,
then lights
is set up to the list of lights in the scene.
reflectivity :Color
- Source:
- Overrides:
Reflectivity of the material. Each channel (red, blue, green), interpreted as number between 0 and 1, is the reflectivity coefficient of the corresponding color (0 = no reflectivity, 1 = all light is reflected).
Type:
- Color
usesLight
- Source:
- Overrides:
Says whether the material reacts to (certain) lights in the scene. Default is false.
usesNormal
- Source:
- Overrides:
Says whether the material requires the normal to the shape for its computation. Default is true.
usesUVMap
- Source:
- Overrides:
Says whether the material requires a UV map on the shape for its computation. Default is false.
Methods
glslInstance() → {string}
- Source:
- Overrides:
Compile all the function directly related to the object (e.g. render).
Returns:
- Type
- string
(abstract) glslRender() → {string}
- Source:
- Overrides:
Return the chunk of GLSL code used to compute the color of the material at the given point The render function on the GLSL side should have one of the following signatures
vec3 {{name}}_render(ExtVector v)
vec3 {{name}}_render(ExtVector v, RelVector normal)
vec3 {{name}}_render(ExtVector v, vec2 uv)
vec3 {{name}}_render(ExtVector v, RelVector normal, vec2 uv)
The exact signature depends whether the material requires a normal or UV coordinates. Here v is the vector obtained when we hit the shape. It should return the color as a vec3 of the material at the given point, without taking into account reflections.
Returns:
- Type
- string