API Reference

Class List

LitOptions

The lit 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 Texture#options.fixCubemapSeams).

fog

The type of fog being applied in the shader.

forceFragmentPrecision

Override fragment shader numeric precision.

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

If reflected skybox intensity should be modulated.

toneMap

The type of tone mapping being applied in the shader.

twoSidedLighting

The value of Material#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.

useRefraction

If refraction is used.

useSpecular

If any specular or reflections are needed at all.

Details

Constructor

LitOptions()

Properties

booleanalphaTest

Enable alpha testing. See Material#alphaTest.

booleanalphaToCoverage

Enable alpha to coverage. See Material#alphaToCoverage.

floatambientSH

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

booleanambientSource

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

numberblendType

The value of Material#blendType.

objectchunks

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 Texture#options.fixCubemapSeams).

numberfog

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

stringforceFragmentPrecision

Override fragment shader numeric precision. Can be "lowp", "mediump", "highp" or null to use default.

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.

numberoccludeSpecularFloat

Defines if StandardMaterial#occludeSpecularIntensity constant should affect specular occlusion.

booleanopacityFadesSpecular

Enable specular fade. See Material#opacityFadesSpecular.

stringreflectionSource

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

numbershadingModel

The value of StandardMaterial#shadingModel.

numberskyboxIntensity

If reflected skybox intensity should be modulated.

numbertoneMap

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

booleantwoSidedLighting

The value of Material#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.

booleanuseRefraction

If refraction is used.

booleanuseSpecular

If any specular or reflections are needed at all.