jit.gl.material Reference

Generate materials for 3D objects

jit.gl.material

Description

Produces shaders for high quality rendering that automatically adapt to texture inputs and the number of active lights.

Examples

Discussion

This object requires one argument: the name of a drawing context. A named drawing context is a named instance of a jit.window, jit.pwindow, or jit.matrix object that has an instance of the jit.gl.render object associated with it. Additionally it can reference the name of a jit.gl.node sub-context. This value may also be set via the OB3D drawto attribute. If no argument is present, the object is implicitly added to the first valid drawing context or sub-context found in the current patch or by searching up the patcher hierarchy.

Matrix Operator

matrix inputs:0, matrix outputs:1
Name IOProc Planelink Typelink Dimlink Plane Dim Type
out n/a 1 1 1 1 1 char

More about Matrix Operators

The Jitter MOP

MOP Arguments

MOP Attributes

MOP Messages

Attributes

darkness [float]

Material darkness. Only valid when the diffuse shading model is minnaert.

diffuse_model [symbol]

Diffuse shading model

Possible values:

'lambert' ( Lambertian diffuse shading model )
'oren_nayer' ( Oren-Nayer diffuse shading model )
'toon' ( Toon diffuse shading model )
'minnaert' ( Minnaert diffuse shading model )

diffuse_size [float]

Diffuse toon component size. Only valid when the diffuse shading model is toon.

diffuse_smooth [float]

Diffuse toon component smoothness. Only valid when the diffuse shading model is toon.

drawto [symbol]

Render context name

fog [symbol]

Fog type

Possible values:

'none' ( No fog )
'linear' ( Linear fog )
'exp' ( Exponential fog )
'exp2' ( Squared exponential fog )

heightmap_mode [symbol]

Heightmap mode to use when the heightmap input is in use (default = parallax).

Possible values:

'parallax' ( Parallax heightmap mode )
Parallax heightmap mode is used in conjunction with normal mapping to enhance the depth effect by displacing texture coordinates. A normals input is required when using parallax mode.

'vtf' ( Vertex texture fetch mode )
Vertex texture fetch mode samples the heightmap texture's first channel (red plane) in the vertex program and displaces the vertex position along its normal by that amount. vtf mode requires texture inputs must be non-rectangular (@rectangle 0).

'vtf_normals' ( Vertex texture fetch with normals generation mode )
Vertex texture fetch with normals generation mode is similar to vtf mode but it also regenerates lighting normals for the displaced mesh.

override [int]

Override jit.gl object color material attributes

roughness [float]

Material roughness. Only valid when the diffuse shading model is oren_nayer.

shadow_eps [float]7.0.0

Shadow epsilon (eps) modifies the shape of shadows, and corrects self-shadowing error (default = 0.2). This value is used when the bound object is a shadow-receiver.

shadow_hard [float]7.0.0

Adjust shadow hardness (default = 0.7). This value is used when the bound object is a shadow-receiver.

shadow_radius [float]7.0.0

Adjust shadow blur radius (default = 0.3). This value is used when the bound object is a shadow-receiver.

shadow_soft [float]7.0.0

Adjust shadow softness (default = 0.3). Overwrites shadow_radius and shadow_hard attributes. This value is used when the bound object is a shadow-receiver.

specular_model [symbol]

Specular shading model

Possible values:

'blinn' ( Blinn specular shading model )
'phong' ( Phong specular shading model )
'toon' ( Toon specular shading model )
'ward' ( Ward specular shading model )
'cook_torrance' ( Cook-Torrance specular shading model )

specular_size [float]

Specular toon component size. Only valid when the specular shading model is toon.

specular_smooth [float]

Specular toon component smoothness. Only valid when the specular shading model is toon.

type [symbol]

g/s(get)

Material type (a descriptive name of the material).

Common Box Attributes

OB3D Attributes

Messages

(drag)

Drag and drop a Jitter material file (.jitmtl)

ambient_texture

Arguments

name [symbol]
Set ambient texture

bind

Bind the material for use

(mouse)

Open the materials browser

diffuse_texture

Arguments

name [symbol]
Set diffuse texture

emission_texture

Arguments

name [symbol]
Set emission texture

environment_texture

Arguments

name [symbol]
Set the environment texture. The environment texture can be a jit.gl.texture or a jit.gl.cubemap)

getparamdefault

Arguments

name [symbol]
Get parameter default value

getparamlist

Get list of parameter names

getparamtype

Arguments

name [symbol]
Get parameter type

getparamval

Arguments

name [symbol]
Get the parameter value

glossmap_texture

Set glossmap texture

heightmap_texture

Set heightmap texture

normals_texture

Arguments

name [symbol]
Set the normals texture. The normals texture will add a bump-mapping effect to the material.

open

Open the materials browser

param

Arguments

name [symbol]
values [list]
Set material parameter value

reset

Reset shading model and colors

reset_colors

Reset colors to default values

reset_shading_model

Reset shading model to default values

specular_texture

Arguments

name [symbol]
Set specular texture

unbind

Unbind the material from use

wclose

Close material browser

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
jit.gl.cubemap
jit.gl.model
jit.gl.render
jit.gl.shader
jit.gl.texture