WebGL Renderer Constants — Soft8Soft
Description: List of WebGL renderer constants used in Verge3D.

# WebGLRenderer Constants

These constants define parameters of the WebGL renderer.

- Cull Face Modes
- Shadow Types
- Tone Mapping
- OIT Algorithms

#

## Cull Face Modes

`v3d.CullFaceNone v3d.CullFaceBack v3d.CullFaceFront v3d.CullFaceFrontBack`

- CullFaceNone disables face culling.
- CullFaceBack culls back faces (default).
- CullFaceFront culls front faces.
- CullFaceFrontBack culls both front and back faces.

#

## Shadow Types

`v3d.BasicShadowMap v3d.BilinearShadowMap v3d.PCFShadowMap v3d.ESMShadowMap`

These define the WebGLRenderer's shadowMap.type property.

- BasicShadowMap gives unfiltered shadow maps — fastest, but lowest quality.
- BilinearShadowMap gives bilinearly filtered shadow maps — slightly better quality quality.
- PCFShadowMap filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm with additional softening by using a randomly rotated Poisson disk. This algorithm is used by default.
- ESMShadowMap uses Exponential Shadow Mapping (ESM) algorithm with Gaussian blur softening.

#

## Tone Mapping

`v3d.NoToneMapping v3d.LinearToneMapping v3d.PbrNeutralToneMapping v3d.AgXBlenderToneMapping v3d.FilmicBlenderToneMapping v3d.LogarithmicMaxToneMapping v3d.PhysicalMaxToneMapping v3d.CustomToneMapping`

These define the WebGLRenderer's toneMapping property. This is used to approximate the appearance of high dynamic range (HDR) on the low dynamic range medium of a standard computer monitor or mobile device's screen.

All mapping types except `v3d.CustomToneMapping` are the built-in implementations of tone mapping. `v3d.CustomToneMapping` expects a custom implementation by modyfing GLSL code of the corresponding fragment shader chunk:

`v3d.ShaderChunk.tonemapping_pars_fragment = v3d.ShaderChunk.tonemapping_pars_fragment.replace( 'vec3 CustomToneMapping(vec3 color){return color;}', 'vec3 CustomToneMapping(vec3 color){return pow(color, vec3(2.2));}' ); app.renderer.toneMapping = v3d.CustomToneMapping;`

#

## OIT Algorithms

`v3d.NoOIT v3d.OITWeighted`

Algorithm to use for order-independent transparency: none or weighted blended.

## Source

For more info on how to obtain the source code of this module see this page.