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

GodRaysMaterial

Extends:

three~ShaderMaterial → GodRaysMaterial

A crepuscular rays shader material.

References:

Thibaut Despoulain, 2012: (WebGL) Volumetric Light Approximation in Three.js Nvidia, GPU Gems 3, 2008: Chapter 13. Volumetric Light Scattering as a Post-Process

TODO:

  • Remove dithering code from fragment shader.

Constructor Summary

Public Constructor
public

constructor(lightPosition: Vector2)

Constructs a new god rays material.

Member Summary

Public Members
public get

The decay.

public set
public get

The density.

public set
public get

The exposure.

public set
public set

inputBuffer: Texture

The input buffer.

public get

lightPosition: Vector2

The screen space position of the light source.

public get

The maximum light intensity.

public set
public
public get

The amount of samples per pixel.

public set
public get

The weight.

public set

Method Summary

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

Returns the decay.

public
this method was deprecated. Use density instead.

Returns the density.

public
this method was deprecated. Use exposure instead.

Returns the exposure.

public

getLightPosition(): Vector2

this method was deprecated. Use lightPosition instead.

Returns the screen space position of the light source.

public
this method was deprecated. Use maxIntensity instead.

Returns the maximum light intensity.

public
this method was deprecated. Use samples instead.

Returns the amount of samples per pixel.

public
this method was deprecated. Use weight instead.

Returns the weight.

public

setDecay(value: Number)

this method was deprecated. Use decay instead.

Sets the decay.

public

setDensity(value: Number)

this method was deprecated. Use density instead.

Sets the density.

public
this method was deprecated. Use exposure instead.

Sets the exposure.

public

setInputBuffer(value: Texture)

this method was deprecated. Use inputBuffer instead.

Sets the input buffer.

public

setLightPosition(value: Vector2)

this method was deprecated. Use lightPosition instead.

Sets the screen space position of the light source.

public
this method was deprecated. Use maxIntensity instead.

Sets the maximum light intensity.

public

setSamples(value: Number)

this method was deprecated. Use samples instead.

Sets the amount of samples per pixel.

public

setWeight(value: Number)

this method was deprecated. Use weight instead.

Sets the weight.

Public Constructors

public constructor(lightPosition: Vector2) source

Constructs a new god rays material.

TODO Remove lightPosition param.

Params:

NameTypeAttributeDescription
lightPosition Vector2

Deprecated.

Public Members

public get decay: Number source

The decay.

public set decay source

public get density: Number source

The density.

public set density source

public get exposure: Number source

The exposure.

public set exposure source

public set inputBuffer: Texture source

The input buffer.

public get lightPosition: Vector2 source

The screen space position of the light source.

public get maxIntensity: Number source

The maximum light intensity.

public set maxIntensity source

public needsUpdate: boolean source

public get samples: Number source

The amount of samples per pixel.

public set samples source

public get weight: Number source

The weight.

public set weight source

Public Methods

public getDecay(): Number source

this method was deprecated. Use decay instead.

Returns the decay.

Return:

Number

The decay.

public getDensity(): Number source

this method was deprecated. Use density instead.

Returns the density.

Return:

Number

The density.

public getExposure(): Number source

this method was deprecated. Use exposure instead.

Returns the exposure.

Return:

Number

The exposure.

public getLightPosition(): Vector2 source

this method was deprecated. Use lightPosition instead.

Returns the screen space position of the light source.

Return:

Vector2

The position.

public getMaxIntensity(): Number source

this method was deprecated. Use maxIntensity instead.

Returns the maximum light intensity.

Return:

Number

The maximum light intensity.

public getSamples(): Number source

this method was deprecated. Use samples instead.

Returns the amount of samples per pixel.

Return:

Number

The sample count.

public getWeight(): Number source

this method was deprecated. Use weight instead.

Returns the weight.

Return:

Number

The weight.

public setDecay(value: Number) source

this method was deprecated. Use decay instead.

Sets the decay.

Params:

NameTypeAttributeDescription
value Number

The decay.

public setDensity(value: Number) source

this method was deprecated. Use density instead.

Sets the density.

Params:

NameTypeAttributeDescription
value Number

The density.

public setExposure(value: Number) source

this method was deprecated. Use exposure instead.

Sets the exposure.

Params:

NameTypeAttributeDescription
value Number

The exposure.

public setInputBuffer(value: Texture) source

this method was deprecated. Use inputBuffer instead.

Sets the input buffer.

Params:

NameTypeAttributeDescription
value Texture

The input buffer.

public setLightPosition(value: Vector2) source

this method was deprecated. Use lightPosition instead.

Sets the screen space position of the light source.

Params:

NameTypeAttributeDescription
value Vector2

The position.

public setMaxIntensity(value: Number) source

this method was deprecated. Use maxIntensity instead.

Sets the maximum light intensity.

Params:

NameTypeAttributeDescription
value Number

The maximum light intensity.

public setSamples(value: Number) source

this method was deprecated. Use samples instead.

Sets the amount of samples per pixel.

Params:

NameTypeAttributeDescription
value Number

The sample count.

public setWeight(value: Number) source

this method was deprecated. Use weight instead.

Sets the weight.

Params:

NameTypeAttributeDescription
value Number

The weight.