Materials
- class Material()
Abstract class for materials
Constructor.
- Material.Material
Constructor.
- Material.isMaterial
type: boolean
Says that the object inherits from Material
- Material.isReflecting
Says whether the material is reflecting Default is false.
- Material.isTransparent
Says whether the material is transparent Default is false.
- Material.lights
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.
- Material.reflectivity
type: Color
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).
- Material.usesLight
Says whether the material reacts to (certain) lights in the scene. Default is false.
- Material.usesNormal
Says whether the material requires the normal to the shape for its computation. Default is true.
- Material.usesUVMap
Says whether the material requires a UV map on the shape for its computation. Default is false.
- Material.glslInstance()
Compile all the function directly related to the object (e.g. render).
- Returns:
string –
- Material.glslRender()
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 - vec4 {{name}}_render(ExtVector v) - vec4 {{name}}_render(ExtVector v, RelVector normal) - vec4 {{name}}_render(ExtVector v, vec2 uv) - vec4 {{name}}_render(ExtVector v, RelVector normal, vec2 uv) The exact signature depends on 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:
string –
- class PTMaterial()
Abstract class for materials for path tracer
Constructor.
- PTMaterial.PTMaterial
Constructor.
- PTMaterial.isPTMaterial
type: boolean
Says that the object inherits from PTMaterial
- PTMaterial.usesNormal
Says whether the material requires the normal to the shape for its computation. Default is true.
- PTMaterial.usesUVMap
Says whether the material requires a UV map on the shape for its computation. Default is false.
- PTMaterial.glslInstance()
Compile all the function directly related to the object (e.g. render).
- Returns:
string –
- PTMaterial.glslRender()
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 signatures - vec3 {{name}}_render(RelVector v) - vec3 {{name}}_render(RelVector v, RelVector normal) - vec3 {{name}}_render(RelVector v, vec2 uv) - vec3 {{name}}_render(RelVector v, RelVector normal, vec2 uv) The exact signature depends on 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:
string –