Class GodRaysEffect

A god rays effect.

Hierarchy (view full)

Constructors

  • Constructs a new god rays effect.

    Parameters

    • Optional camera: Camera

      The main camera.

    • Optional lightSource: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | Points<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

      The light source. Must not write depth and has to be flagged as transparent.

    • Optional options: {
          blendFunction?: BlendFunction;
          blur?: boolean;
          clampMax?: number;
          decay?: number;
          density?: number;
          exposure?: number;
          height?: number;
          kernelSize?: KernelSize;
          resolutionScale?: number;
          resolutionX?: number;
          resolutionY?: number;
          samples?: number;
          weight?: number;
          width?: number;
      }

      The options.

      • Optional blendFunction?: BlendFunction

        The blend function of this effect.

      • Optional blur?: boolean

        Whether the god rays should be blurred to reduce artifacts.

      • Optional clampMax?: number

        An upper bound for the saturation of the overall effect.

      • Optional decay?: number

        An illumination decay factor.

      • Optional density?: number

        The density of the light rays.

      • Optional exposure?: number

        A constant attenuation coefficient.

      • Optional height?: number

        Deprecated. Use resolutionY instead.

      • Optional kernelSize?: KernelSize

        The blur kernel size. Has no effect if blur is disabled.

      • Optional resolutionScale?: number

        The resolution scale.

      • Optional resolutionX?: number

        The horizontal resolution.

      • Optional resolutionY?: number

        The vertical resolution.

      • Optional samples?: number

        The number of samples per pixel.

      • Optional weight?: number

        A light ray weight factor.

      • Optional width?: number

        Deprecated. Use resolutionX instead.

    Returns GodRaysEffect

Properties

blendMode: BlendMode

The blend mode of this effect.

blurPass: KawaseBlurPass

A blur pass that reduces aliasing artifacts and makes the light softer.

This pass can be disabled to improve performance.

defines: Map<string, string>

Preprocessor macro definitions.

Call Effect.setChanged after changing macro definitions.

extensions: Set<WebGLExtension>

WebGL extensions that are required by this effect.

Call Effect.setChanged after adding or removing extensions.

name: string

The name of this effect.

renderer: WebGLRenderer

The renderer.

Deprecated

uniforms: Map<string, Uniform<any>>

Shader uniforms.

Call Effect.setChanged after adding or removing uniforms.

Accessors

  • get blur(): boolean
  • Indicates whether the god rays should be blurred to reduce artifacts.

    Returns boolean

    Deprecated

    Use blurPass.enabled instead.

  • set blur(arg): void
  • Parameters

    • arg: boolean

    Returns void

  • get depthMaskMaterial(): DepthMaskMaterial
  • The depth mask material.

    Returns DepthMaskMaterial

  • get dithering(): boolean
  • Indicates whether dithering is enabled.

    Returns boolean

    Deprecated

  • set dithering(arg): void
  • Parameters

    • arg: boolean

    Returns void

  • get godRaysMaterial(): GodRaysMaterial
  • The internal god rays material.

    Returns GodRaysMaterial

  • get height(): number
  • The current height of the internal render targets.

    Returns number

    Deprecated

    Use resolution.height instead.

  • set height(arg): void
  • Parameters

    • arg: number

    Returns void

  • get inputColorSpace(): ColorSpace
  • Experimental

    The input color space.

    Returns ColorSpace

  • set inputColorSpace(arg): void
  • Protected Experimental

    Parameters

    • arg: ColorSpace

    Returns void

  • get kernelSize(): KernelSize
  • The blur kernel size.

    Returns KernelSize

    Deprecated

    Use blurPass.kernelSize instead.

  • set kernelSize(arg): void
  • Parameters

    Returns void

  • get lightSource(): Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | Points<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>
  • Sets the light source.

    Returns Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | Points<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

  • set lightSource(value): void
  • Parameters

    • value: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | Points<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

    Returns void

  • set mainCamera(arg): void
  • Sets the main camera.

    Parameters

    • arg: Camera

    Returns void

  • set mainScene(arg): void
  • Sets the main scene.

    Parameters

    • arg: Scene

    Returns void

  • get outputColorSpace(): ColorSpace
  • Experimental

    The output color space.

    Should only be changed if this effect converts the input colors to a different color space.

    Returns ColorSpace

  • set outputColorSpace(arg): void
  • Protected Experimental

    Parameters

    • arg: ColorSpace

    Returns void

  • get resolution(): Resolution
  • The resolution of this effect.

    Returns Resolution

  • get samples(): number
  • The number of samples per pixel.

    Returns number

    Deprecated

    Use godRaysMaterial.samples instead.

  • set samples(arg): void
  • A higher sample count improves quality at the cost of performance.

    Parameters

    • arg: number

    Returns void

    Deprecated

    Use godRaysMaterial.samples instead.

  • get texture(): Texture
  • A texture that contains the intermediate result of this effect.

    Returns Texture

  • get width(): number
  • The current width of the internal render targets.

    Returns number

    Deprecated

    Use resolution.width instead.

  • set width(arg): void
  • Parameters

    • arg: number

    Returns void

Methods

  • Performs a shallow search for properties that define a dispose method and deletes them.

    The EffectComposer calls this method when it is being destroyed.

    Returns void

  • Returns the blend mode.

    The result of this effect will be blended with the result of the previous effect using this blend mode.

    Returns BlendMode

    The blend mode.

    Deprecated

    Use blendMode instead.

  • Returns the blur pass that reduces aliasing artifacts and makes the light softer.

    Returns KawaseBlurPass

    The blur pass.

    Deprecated

    Use blurPass instead.

  • Returns the preprocessor macro definitions.

    Returns Map<string, string>

    The extensions.

    Deprecated

    Use defines instead.

  • Returns the WebGL extensions that are required by this effect.

    Returns Set<WebGLExtension>

    The extensions.

    Deprecated

    Use extensions instead.

  • Returns the fragment shader.

    Returns string

    The fragment shader.

  • Returns the god rays material.

    Returns GodRaysMaterial

    The material.

    Deprecated

    Use godRaysMaterial instead.

  • Returns the name of this effect.

    Returns string

    The name.

    Deprecated

    Use name instead.

  • Returns the resolution of this effect.

    Returns GodRaysMaterial

    The material.

    Deprecated

    Use resolution instead.

  • Returns the current resolution scale.

    Returns number

    The resolution scale.

    Deprecated

    Use resolution instead.

  • Returns the god rays texture.

    Returns Texture

    The texture.

    Deprecated

    Use texture instead.

  • Returns the uniforms of this effect.

    Returns Map<string, Uniform<any>>

    The extensions.

    Deprecated

    Use uniforms instead.

  • Returns the vertex shader.

    Returns string

    The vertex shader.

  • Performs initialization tasks.

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    • alpha: boolean

      Whether the renderer uses the alpha channel or not.

    • frameBufferType: number

      The type of the main frame buffers.

    Returns void

  • Protected

    Sets the effect attributes.

    Effects that have the same attributes will be executed in the order in which they were registered. Some attributes imply a higher priority.

    Parameters

    Returns void

  • Protected

    Informs the associated EffectPass that this effect requires a shader recompilation.

    Should be called after changing macros or extensions and after adding/removing uniforms.

    Returns void

  • Sets the depth texture.

    Parameters

    • depthTexture: Texture

      A depth texture.

    • Optional depthPacking: number

      The depth packing.

    Returns void

  • Protected

    Sets the fragment shader.

    Parameters

    • fragmentShader: string

      The fragment shader.

    Returns void

  • Sets the renderer.

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    Returns void

    Deprecated

  • Sets the resolution scale.

    Parameters

    • scale: number

      The new resolution scale.

    Returns void

    Deprecated

    Use resolution instead.

  • Updates the size of internal render targets.

    Parameters

    • width: number

      The width.

    • height: number

      The height.

    Returns void

  • Protected

    Sets the vertex shader.

    Parameters

    • vertexShader: string

      The vertex shader.

    Returns void

  • Updates this effect.

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    • inputBuffer: WebGLRenderTarget<Texture>

      A frame buffer that contains the result of the previous pass.

    • Optional deltaTime: number

      The time between the last frame and the current one in seconds.

    Returns void