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.


alphaTest: boolean = false

Enable alpha testing. See Material#alphaTest.

alphaToCoverage: boolean = false

Enable alpha to coverage. See Material#alphaToCoverage.

ambientSH: boolean = false

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

ambientSource: string = 'constant'

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

blendType: number = BLEND_NONE

The value of Material#blendType.

chunks: {} = {}

Object containing custom shader chunks that will replace default ones.

Type declaration

    conserveEnergy: boolean = false
    cubeMapProjection: number = 0
    customFragmentShader: string = null

    Replaced the whole fragment shader with this string.

    fastTbn: boolean = false

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

    fixSeams: boolean = false

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

    fog: string = FOG_NONE

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

    fresnelModel: number = 0
    gamma: number = GAMMA_NONE

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

    occludeDirect: boolean = false
    occludeSpecular: number = 0
    occludeSpecularFloat: boolean = false

    Defines if StandardMaterial#occludeSpecularIntensity constant should affect specular occlusion.

    opacityDither: string = DITHER_NONE

    Enable opacity dithering. See StandardMaterial#opacityDither.

    opacityFadesSpecular: boolean = false

    Enable specular fade. See StandardMaterial#opacityFadesSpecular.

    opacityShadowDither: string = DITHER_NONE

    Enable opacity shadow dithering. See StandardMaterial#opacityShadowDither.

    reflectionSource: string = null

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

    shadingModel: number = 0
    skyboxIntensity: number = 1.0

    Skybox intensity factor.

    toneMap: number = -1

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

    twoSidedLighting: boolean = false
    useCubeMapRotation: boolean = false

    If cube map rotation is enabled.

    useInstancing: boolean = false

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

    useMetalness: boolean = false
    useMorphNormal: boolean = false

    If morphing code should be generated to morph normals.

    useMorphPosition: boolean = false

    If morphing code should be generated to morph positions.

    useRefraction: boolean = false

    If refraction is used.

    useSpecular: boolean = false

    If any specular or reflections are needed at all.

    userAttributes: {} = {}

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

    Type declaration