jit.gl.cubemap Reference

Manage a cubemap texture target



Maintains a cubemap texture target in an OpenGL context. It has 6 inputs -- one for each face of the cube. Cubemaps are typically used to map an environment for material effects such as reflection and refraction. When sent a texture to any inlet, jit.gl.cubemap adapts to the input type of the texture.



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.




adapt [int]

Enable adapt to input (default = 1). When enabled the texture output dimensions will match the input dimensions.

autotype [symbol]



bordercolor [4 floats]

Sets the texture bordercolor

edge_length [int]

The length in pixels of a cube edge. Each face of the sube will be edge_length*edge_length in dimension.

file [symbol]

Sets an image file to read that is in panorama format

filter [symbol]

Filter applied to the texture.

level [int]

Specify mipmap level to write input data (default = 0). When level is non-zero inputs will overwrite the mipmap image at the specified mipmap level, where 1 is the largest resolution/nearest level. If necessary the data will be scaled for the appropriate level. The height and width of each level in the mipmap is a factor of two smaller than the previous level.

matrix_name [6 symbols]


The named matrix to access (default = none)

mipmap [symbol]

Texture mipmap interpolation style (default = none). A mipmap is a pre-calculated sequence of images, each of which is a progressively lower resolution. Mipmap interpolation is used for minification filtering, a technique for increasing efficiency by changing the amount of texture information displayed based on the position of the textured object in a 3D scene. When the area of the fragment in texture space is larger than a texel, a filtered (reduced size) copy of the texture is used instead. Thus objects that are close can use the highest resolution image, then swap for lower resolution copies as the object gets farther away. Setting mipmap to bilinear (better performance) or trilinear (better image quality) will enable automatic mipmap generation whenever the texture is updated. Possible values:


type [symbol]

Force incoming textures to a particular type. If set to auto, jit.gl.cubemap will adapt to the incoming type, otherwise they will be forced to the type specified. Possible values:


wrap [3 symbols]

Texture wrapping mode.

Common Box Attributes

OB3D Attributes





Sets binding of the cubemap to texture geometry.


Load a matrix formatted in a cross shape containing every face of the cubemap. The panorama matrix layout is a cross shape holding the 6 faces of the cube. The faces are in a 4x3 grid where the rows are formatted as follows:
  1. ** py ** **
  2. nx pz px nz
  3. ** ny ** **


Read in a panorama formatted image file.


Unbinds the cubemap after a bind operation.

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL