API Reference

Class List

LitShaderOptions

The lit shader options determines how the lit-shader gets generated. It specifies a set of parameters which triggers different fragment and vertex shader generation in the backend.

Summary

Properties

alphaTest

Enable alpha testing.

alphaToCoverage

Enable alpha to coverage.

ambientSH

If ambient spherical harmonics are used.

ambientSource

One of "ambientSH", "envAtlas", "constant".

blendType

The value of Material#blendType.

chunks

Object containing custom shader chunks that will replace default ones.

conserveEnergy

The value of StandardMaterial#conserveEnergy.

cubeMapProjection

The value of StandardMaterial#cubeMapProjection.

customFragmentShader

Replaced the whole fragment shader with this string.

fastTbn

Use slightly cheaper normal mapping code (skip tangent space normalization).

fixSeams

If cubemaps require seam fixing (see the fixCubemapSeams property of the options object passed to the Texture constructor).

fog

The type of fog being applied in the shader.

fresnelModel

The value of StandardMaterial#fresnelModel.

gamma

The type of gamma correction being applied in the shader.

occludeDirect

The value of StandardMaterial#occludeDirect.

occludeSpecular

The value of StandardMaterial#occludeSpecular.

occludeSpecularFloat

Defines if StandardMaterial#occludeSpecularIntensity constant should affect specular occlusion.

opacityFadesSpecular

Enable specular fade.

reflectionSource

One of "envAtlasHQ", "envAtlas", "cubeMap", "sphereMap".

shadingModel

The value of StandardMaterial#shadingModel.

skyboxIntensity

Skybox intensity factor.

toneMap

The type of tone mapping being applied in the shader.

twoSidedLighting

The value of StandardMaterial#twoSidedLighting.

useCubeMapRotation

If cube map rotation is enabled.

useInstancing

If hardware instancing compatible shader should be generated.

useMetalness

The value of StandardMaterial#useMetalness.

useMorphNormal

If morphing code should be generated to morph normals.

useMorphPosition

If morphing code should be generated to morph positions.

userAttributes

Object containing a map of user defined vertex attributes to attached shader semantics.

useRefraction

If refraction is used.

useSpecular

If any specular or reflections are needed at all.

Details

Constructor

LitShaderOptions()

Properties

booleanalphaTest

Enable alpha testing. See Material#alphaTest.

booleanalphaToCoverage

Enable alpha to coverage. See Material#alphaToCoverage.

booleanambientSH

If ambient spherical harmonics are used. Ambient SH replace prefiltered cubemap ambient on certain platforms (mostly Android) for performance reasons.

stringambientSource

One of "ambientSH", "envAtlas", "constant".

numberblendType

The value of Material#blendType.

{ [string]: string }chunks

Object containing custom shader chunks that will replace default ones.

booleanconserveEnergy

The value of StandardMaterial#conserveEnergy.

numbercubeMapProjection

The value of StandardMaterial#cubeMapProjection.

stringcustomFragmentShader

Replaced the whole fragment shader with this string.

booleanfastTbn

Use slightly cheaper normal mapping code (skip tangent space normalization). Can look buggy sometimes.

booleanfixSeams

If cubemaps require seam fixing (see the fixCubemapSeams property of the options object passed to the Texture constructor).

stringfog

The type of fog being applied in the shader. See Scene#fog for the list of possible values.

numberfresnelModel

The value of StandardMaterial#fresnelModel.

numbergamma

The type of gamma correction being applied in the shader. See Scene#gammaCorrection for the list of possible values.

booleanoccludeDirect

The value of StandardMaterial#occludeDirect.

numberoccludeSpecular

The value of StandardMaterial#occludeSpecular.

booleanoccludeSpecularFloat

Defines if StandardMaterial#occludeSpecularIntensity constant should affect specular occlusion.

booleanopacityFadesSpecular

Enable specular fade. See StandardMaterial#opacityFadesSpecular.

stringreflectionSource

One of "envAtlasHQ", "envAtlas", "cubeMap", "sphereMap".

numbershadingModel

The value of StandardMaterial#shadingModel.

numberskyboxIntensity

Skybox intensity factor.

numbertoneMap

The type of tone mapping being applied in the shader. See Scene#toneMapping for the list of possible values.

booleantwoSidedLighting

The value of StandardMaterial#twoSidedLighting.

booleanuseCubeMapRotation

If cube map rotation is enabled.

booleanuseInstancing

If hardware instancing compatible shader should be generated. Transform is read from per-instance VertexBuffer instead of shader's uniforms.

booleanuseMetalness

The value of StandardMaterial#useMetalness.

booleanuseMorphNormal

If morphing code should be generated to morph normals.

booleanuseMorphPosition

If morphing code should be generated to morph positions.

{ [string]: string }userAttributes

Object containing a map of user defined vertex attributes to attached shader semantics.

booleanuseRefraction

If refraction is used.

booleanuseSpecular

If any specular or reflections are needed at all.