RenderUtils

A class containing useful rendering methods.

Methods

.assignAllLayersMask(obj : Object3D) → Integer

Enable all possible Verge3D layers for the given object. The function returns the layers mask which was applied to the object before the assignment.

.renderSceneToCubemap(scene : Scene, renderer : WebGLRenderer, cubeRenderTarget : WebGLCubeRenderTarget, cameraOptions : Object) → WebGLCubeRenderTarget

Render the given scene into a cubemap. The parameters are:

scene
Scene to render into a cubemap
renderer
WebGLRenderer
cubeRenderTarget
WebGLCubeRenderTarget render target containing the cubemap to render into
cameraOptions
An object containing options for the cube camera used to render the scene into the cubemap; the options and their default values are:
camPos — cube camera position
clipStart — near plane value
clipEnd — far plane value
{ camPos: new Vector3(), clipStart: 0.1, clipEnd: 100 }

.renderWorldNodeMatToCubemap(renderer : WebGLRenderer, material : MeshNodeMaterial, cubeRes : Integer, options : Object) → WebGLCubeRenderTarget

Render a world node material to a cubemap. The parameters are:

renderer
WebGLRenderer
material
world node material, should be of type MeshNodeMaterial
cubeRes
resolution of the rendered cubemap
options
(optional) object that holds texture parameters for an auto-generated cube render target; has the same format as the options parameter for the WebGLCubeRenderTarget constructor

The resulting render target with a cube texture in it can be used as a scene background.