GodRaysMaterial
Extends:
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 |
getDensity(): Number 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 |
getSamples(): Number 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 |
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 |
setExposure(value: Number) 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 |
setMaxIntensity(value: Number) 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 |
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:
Name | Type | Attribute | Description |
lightPosition | Vector2 | Deprecated. |
Public Members
public set decay source
public set density source
public set exposure source
public set maxIntensity source
public set samples source
public set weight source
Public Methods
public getDensity(): Number source
Returns the density.
public getExposure(): Number source
Returns the exposure.
public getLightPosition(): Vector2 source
Returns the screen space position of the light source.
Return:
Vector2 | The position. |
public getMaxIntensity(): Number source
Returns the maximum light intensity.
public getSamples(): Number source
Returns the amount of samples per pixel.
public getWeight(): Number source
Returns the weight.
public setDecay(value: Number) source
Sets the decay.
Params:
Name | Type | Attribute | Description |
value | Number | The decay. |
public setDensity(value: Number) source
Sets the density.
Params:
Name | Type | Attribute | Description |
value | Number | The density. |
public setExposure(value: Number) source
Sets the exposure.
Params:
Name | Type | Attribute | Description |
value | Number | The exposure. |
public setInputBuffer(value: Texture) source
Sets the input buffer.
Params:
Name | Type | Attribute | Description |
value | Texture | The input buffer. |
public setLightPosition(value: Vector2) source
Sets the screen space position of the light source.
Params:
Name | Type | Attribute | Description |
value | Vector2 | The position. |
public setMaxIntensity(value: Number) source
Sets the maximum light intensity.
Params:
Name | Type | Attribute | Description |
value | Number | The maximum light intensity. |