Home Reference Source
import {GodRaysEffect} from 'postprocessing'
public class | source

GodRaysEffect

Extends:

three~EventDispatcherEffect → GodRaysEffect

Indirect Implements:

A god rays effect.

Constructor Summary

Public Constructor
public

constructor(camera: Camera, lightSource: Mesh | Points, options: Object)

Constructs a new god rays effect.

Member Summary

Public Members
public get
this get was deprecated. Use blurPass.enabled instead.

Indicates whether the god rays should be blurred to reduce artifacts.

public set
public

A blur pass that reduces aliasing artifacts to make the light softer.

public get
this get was deprecated.

Indicates whether dithering is enabled.

public set
public get

The internal god rays material.

public get
this get was deprecated. Use resolution.height instead.

The current height of the internal render targets.

public set
public get
this get was deprecated. Use blurPass.kernelSize instead.

The blur kernel size.

public set
public get

lightSource: Mesh | Points

Sets the light source.

public set
public set
public get
this get was deprecated. Use godRaysMaterial.samples instead.

The number of samples per pixel.

public set
this set was deprecated. Use godRaysMaterial.samples instead.

A higher sample count improves quality at the cost of performance.

public get

texture: Texture

A texture that contains the intermediate result of this effect.

public get
this get was deprecated. Use resolution.width instead.

The current width of the internal render targets.

public set

Method Summary

Public Methods
public
this method was deprecated. Use blurPass instead.

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

public
this method was deprecated. Use godRaysMaterial instead.

Returns the god rays material.

public
this method was deprecated. Use resolution instead.

Returns the resolution of this effect.

public
this method was deprecated. Use resolution instead.

Returns the current resolution scale.

public

getTexture(): Texture

this method was deprecated. Use texture instead.

Returns the god rays texture.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public

setDepthTexture(depthTexture: Texture, depthPacking: Number)

Sets the depth texture.

public
this method was deprecated. Use resolution instead.

Sets the resolution scale.

public

setSize(width: Number, height: Number)

Updates the size of internal render targets.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number)

Updates this effect.

Inherited Summary

From class Effect
public get

inputColorSpace: ColorSpace

this get is experimental.

The input color space.

public set

mainCamera: Camera

Sets the main camera.

public set

mainScene: Scene

Sets the main scene.

public get

outputColorSpace: ColorSpace

this get is experimental.

The output color space.

protected set

inputColorSpace: ColorSpace

this set is experimental.
protected set

outputColorSpace: ColorSpace

this set is experimental.
public

The blend mode of this effect.

public

Preprocessor macro definitions.

public

WebGL extensions that are required by this effect.

public

The name of this effect.

public

uniforms: Map<String, Uniform>

Shader uniforms.

protected

renderer: WebGLRenderer

this member was deprecated.

The renderer.

public

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

public

Returns the effect attributes.

public
this method was deprecated. Use blendMode instead.

Returns the blend mode.

public
this method was deprecated. Use defines instead.

Returns the preprocessor macro definitions.

public
this method was deprecated. Use extensions instead.

Returns the WebGL extensions that are required by this effect.

public

Returns the fragment shader.

public
this method was deprecated. Use name instead.

Returns the name of this effect.

public

getUniforms(): Map<String, Uniform>

this method was deprecated. Use uniforms instead.

Returns the uniforms of this effect.

public

Returns the vertex shader.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public

setDepthTexture(depthTexture: Texture, depthPacking: DepthPackingStrategies)

Sets the depth texture.

public

setRenderer(renderer: WebGLRenderer)

this method was deprecated.

Sets the renderer.

public

setSize(width: Number, height: Number)

Updates the size of this effect.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number)

Updates this effect by performing supporting operations.

protected

Sets the effect attributes.

protected

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

protected

setFragmentShader(fragmentShader: String)

Sets the fragment shader.

protected

setVertexShader(vertexShader: String)

Sets the vertex shader.

Public Constructors

public constructor(camera: Camera, lightSource: Mesh | Points, options: Object) source

Constructs a new god rays effect.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
camera Camera
  • optional

The main camera.

lightSource Mesh | Points
  • optional

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

options Object
  • optional

The options.

options.blendFunction BlendFunction
  • optional
  • default: BlendFunction.SCREEN

The blend function of this effect.

options.samples Number
  • optional
  • default: 60.0

The number of samples per pixel.

options.density Number
  • optional
  • default: 0.96

The density of the light rays.

options.decay Number
  • optional
  • default: 0.9

An illumination decay factor.

options.weight Number
  • optional
  • default: 0.4

A light ray weight factor.

options.exposure Number
  • optional
  • default: 0.6

A constant attenuation coefficient.

options.clampMax Number
  • optional
  • default: 1.0

An upper bound for the saturation of the overall effect.

options.resolutionScale Number
  • optional
  • default: 0.5

The resolution scale.

options.resolutionX Number
  • optional
  • default: Resolution.AUTO_SIZE

The horizontal resolution.

options.resolutionY Number
  • optional
  • default: Resolution.AUTO_SIZE

The vertical resolution.

options.width Number
  • optional
  • default: Resolution.AUTO_SIZE

Deprecated. Use resolutionX instead.

options.height Number
  • optional
  • default: Resolution.AUTO_SIZE

Deprecated. Use resolutionY instead.

options.kernelSize KernelSize
  • optional
  • default: KernelSize.SMALL

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

options.blur Boolean
  • optional
  • default: true

Whether the god rays should be blurred to reduce artifacts.

Public Members

public get blur: Boolean source

this get was deprecated. Use blurPass.enabled instead.

Indicates whether the god rays should be blurred to reduce artifacts.

public set blur source

public blurPass: KawaseBlurPass source

A blur pass that reduces aliasing artifacts to make the light softer.

This pass can be disabled to improve performance.

public get dithering: Boolean source

this get was deprecated.

Indicates whether dithering is enabled.

public set dithering source

public get godRaysMaterial: GodRaysMaterial source

The internal god rays material.

public get height: Number source

this get was deprecated. Use resolution.height instead.

The current height of the internal render targets.

public set height source

public get kernelSize: KernelSize source

this get was deprecated. Use blurPass.kernelSize instead.

The blur kernel size.

public set kernelSize source

public get lightSource: Mesh | Points source

Sets the light source.

public set lightSource source

public set mainCamera source

Sets the main camera.

Override:

Effect#mainCamera

public get samples: Number source

this get was deprecated. Use godRaysMaterial.samples instead.

The number of samples per pixel.

public set samples: Number source

this set was deprecated. Use godRaysMaterial.samples instead.

A higher sample count improves quality at the cost of performance.

public get texture: Texture source

A texture that contains the intermediate result of this effect.

public get width: Number source

this get was deprecated. Use resolution.width instead.

The current width of the internal render targets.

public set width source

Public Methods

public getBlurPass(): KawaseBlurPass source

this method was deprecated. Use blurPass instead.

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

Return:

KawaseBlurPass

The blur pass.

public getGodRaysMaterial(): GodRaysMaterial source

this method was deprecated. Use godRaysMaterial instead.

Returns the god rays material.

Return:

GodRaysMaterial

The material.

public getResolution(): GodRaysMaterial source

this method was deprecated. Use resolution instead.

Returns the resolution of this effect.

Return:

GodRaysMaterial

The material.

public getResolutionScale(): Number source

this method was deprecated. Use resolution instead.

Returns the current resolution scale.

Return:

Number

The resolution scale.

public getTexture(): Texture source

this method was deprecated. Use texture instead.

Returns the god rays texture.

Return:

Texture

The texture.

public initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number) source

Performs initialization tasks.

Override:

Effect#initialize

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

alpha Boolean

Whether the renderer uses the alpha channel or not.

frameBufferType Number

The type of the main frame buffers.

public setDepthTexture(depthTexture: Texture, depthPacking: Number) source

Sets the depth texture.

Override:

Effect#setDepthTexture

Params:

NameTypeAttributeDescription
depthTexture Texture

A depth texture.

depthPacking Number
  • optional
  • default: BasicDepthPacking

The depth packing.

public setResolutionScale(scale: Number) source

this method was deprecated. Use resolution instead.

Sets the resolution scale.

Params:

NameTypeAttributeDescription
scale Number

The new resolution scale.

public setSize(width: Number, height: Number) source

Updates the size of internal render targets.

Override:

Effect#setSize

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.

public update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number) source

Updates this effect.

Override:

Effect#update

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

inputBuffer WebGLRenderTarget

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

deltaTime Number
  • optional

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