jit.gl.pbr Reference

Generate physically based rendering materials for 3D objects



Produces shaders for physically based rendering ( PBR ) that automatically adapt to texture inputs and the number of active lights. Image based lighting ( IBL ) effects are facilitated via the environment_texture input.


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.


drawto [symbol]

Render context or sub-context name

gamma_correction [int]

Enable gamma corrections (default = 1). Enabling will convert the rendered output from linear color space to non-linear sRGB color space. Users should leave enabled unless applying gamma correction at a later stage in the pipeline, e.g. via jit.gl.pass.

height_scale [float]

Height scaling factor when parallax enabled (default = 1)

metalness [float]

Determines the metallic value in the material calculation (default = 0.). Fully metallic materials leave only reflected or specular light and show no diffuse (albedo) colors. If a metallic_texture map is sent then metalness should be set to 1 for expected output.

name [symbol]

The instance name (default = UID)

override [int]

Override jit.gl object color material attributes

parallax [int]

Enable parallax height mapping (default = 0). Requires a height map image sent to the heightmap_texture input. When enabled both normals and ambient occlusion maps are ignored and tex_gen mode is disabled.

parallax_shadowing [2 floats]

Parallax heightmap shadowing values (default = 0.3 0.1). The first value sets the amount of self-shadowing (when self_shadow is enabled) and the second value sets the amount of ambient occlusion shadowing.

reflection [int]

Enable reflections from the environment map (default = 1). When enabled a specular reflections map is generated from the environment map input and the shader will use specular reflection calculations when rendering.

roughness [float]

Determines the microsurface's roughness in the bidirectional reflective distribution function ( BRDF ) (default = 0.3). Perfectly smooth surfaces have a roughness of 0. If a roughness_texture map is sent then roughness should be set to 1 for expected output.

self_shadow [int]

Enables self shadowing when parallax enabled (default = 0).

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.

tex_gen [symbol]

Texture coordinate generation mode (default = "none"). When enabled texture coordinates are generated from world space projections of two planes (biplanar) or three planes (triplanar). Possible values:

'none' ( No generation )
'biplanar' ( Generate from two planes of projection )
'triplanar' ( Generate from three planes of projection )

tex_repeat [2 floats]

Horizontal and vertical multipliers of texture coordinates (default = 1 1). Values greater than 1 cause repetitions when texture mapping. The attribute effects both tex_gen mode none and triplanar .

triplanar_blend [float]

The triplanar blending amount adjusts the fade between planar projections when tex_gen mode is triplanar (default = 0.7).

Common Box Attributes

OB3D Attributes



Sets the texture to use for the albedo map. The albedo texture, like a standard diffuse texture, sets the base color for rendering (or the base reflectivity if the textured object is metallic). Unlike a standard diffuse texture, albedo textures in PBR rendering typically have no directional lighting or ambient occlusion.


Sets the texture to use for the ambient occlusion map. Ambient occlusion textures are used to add additional detail to shadowy parts of a surface and are optional.


Sending the clear message to jit.gl.pbr will clear the image map at the corresponding input.


Sets the texture to use for the emission map. The emission map determines the color of light that is emitted by the object surface. In the final rendered image, the emissive lighting (emission_texture * mat_emission) color is added to the calculated lighting color.


Sets the texture to use for the environment map. The environment map is used for calculating reflections using Image based lighting ( IBL ) effects. These are usually .env files and the same texture is read into a jit.gl.cubemap rendered via jit.gl.skybox, however, any texture can be used.





name [symbol]
Get parameter default value


Get list of parameter names



name [symbol]
Get parameter type



name [symbol]
Get the parameter value


Set the texture to use for the heightmap. The heightmap stores the height data for an object. Each pixel stores a height value that represents the height distance perpendicular to the face of the object surface.


Sets the texture to use for the metallic map. Metallic textures determine the reflectivity of the textured object and support grayscale maps, where 0 represents no metalness (no reflective light color is added to the albedo) and 1 full metalness (only reflective light is displayed). The metallic_texture is multiplied by the metalness attribute to calculate final reflectivity.


Sets the texture to use for the normals map. The normals map determines the angles of reflection for the mapped object's surface to be used when calculating lighting.



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


Sets the texture to use for the roughness map. The roughness affects the quality of reflections on a surface. Low roughness results in crisp and clear reflections, while higher roughness diffuses them, resulting in wider and blurrier reflections. Overall roughness is determined by multiplying the roughness roughness attribute by the roughness texture.

OB3D Messages

See Also

Name Description