Engine API Reference - v2.23.0-beta.17
    Preparing search index...

    Class 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.

    You do not create one. The engine fills a LitShaderOptions from the material and scene state each time a StandardMaterial needs a shader variant, and every distinct set of values produces a distinct compiled shader. Developers rarely need to touch it: the material properties such as useFog, useLighting and useSkybox on StandardMaterial cover the usual cases, and the values here mirror them together with the scene state. It is exposed for the rare case of customizing shader generation through StandardMaterial#onUpdateShader.

    Index
    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.

    cubeMapProjection: number = 0
    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 CameraComponent#gammaCorrection for the list of possible values.

    linearDepth: boolean = false

    Make vLinearDepth available in the shader.

    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 = REFLECTIONSRC_NONE

    One of REFLECTIONSRC_*** constants.

    shaderChunks: ShaderChunks | null = null

    Custom shader chunks that will replace default ones.

    shadowCatcher: boolean = false

    Shader outputs the accumulated shadow value, used for shadow catcher materials.

    skyboxIntensity: number = 1.0

    Skybox intensity factor.

    ssao: boolean = false

    Apply SSAO during the lighting.

    toneMap: number = -1

    The type of tone mapping being applied in the shader. See CameraComponent#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.

    userAttributes: {} = {}

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

    useRefraction: boolean = false

    If refraction is used.

    useSceneEnv: boolean = false

    If the environment chunks sample the scene environment, published by the renderer as scene_envAtlas and scene_skybox, instead of the textures owned by the material (texture_envAtlas, texture_cubeMap).

    useSpecular: boolean = false

    If any specular or reflections are needed at all.