Constructor Summary
Public Constructor | ||
public |
constructor(scene: Scene, camera: Camera, lightSource: Object3D, options: Object) Constructs a new god rays effect. |
Member Summary
Public Members | ||
public get |
Indicates whether the god rays should be blurred to reduce artifacts. |
|
public set |
|
|
public get |
Indicates whether dithering is enabled. |
|
public set |
Enables or disables dithering. |
|
public get |
The internal god rays material. |
|
public set |
|
|
public get |
The blur kernel size. |
|
public |
lightSource: Object3D The light source. |
|
public get |
The number of samples per pixel. |
|
public set |
This value must be carefully chosen. |
|
public get |
texture: Texture A texture that contains the intermediate result of this effect. |
Private Members | ||
private |
A blur pass. |
|
private |
camera: Camera The main camera. |
|
private |
A god rays pass. |
|
private |
lightScene: Scene A scene that only contains the light source. |
|
private |
A pass that only renders the light source. |
|
private |
A pass that renders the masked scene over the light source. |
|
private |
renderTargetMask: WebGLRenderTarget A render target for the masked light scene. |
|
private |
renderTargetX: WebGLRenderTarget A render target. |
|
private |
renderTargetY: WebGLRenderTarget A second render target. |
|
private |
resolution: Vector2 The original resolution. |
|
private |
scene: Scene The main scene. |
|
private |
screenPosition: Vector3 The light position in screen space. |
Method Summary
Public Methods | ||
public |
Returns the current resolution scale. |
|
public |
initialize(renderer: WebGLRenderer, alpha: Boolean) Performs initialization tasks. |
|
public |
setResolutionScale(scale: Number) Sets the resolution scale. |
|
public |
Updates the size of internal render targets. |
|
public |
Updates this effect. |
Inherited Summary
From class Effect | ||
public |
[key]: * |
|
public |
The effect attributes. |
|
public |
The blend mode of this effect. |
|
public |
Preprocessor macro definitions. |
|
public |
The fragment shader. |
|
public |
The name of this effect. |
|
public |
Shader uniforms. |
|
public |
The vertex shader. |
|
public |
dispose() Performs a shallow search for properties that define a dispose method and deletes them. |
|
public |
initialize(renderer: WebGLRenderer, alpha: Boolean) Performs initialization tasks. |
|
public |
setDepthTexture(depthTexture: Texture, depthPacking: Number) Sets the depth texture. |
|
public |
Updates the size of this effect. |
|
public |
Updates the effect by performing supporting operations. |
Public Constructors
public constructor(scene: Scene, camera: Camera, lightSource: Object3D, options: Object) source
Constructs a new god rays effect.
Override:
Effect#constructorParams:
Name | Type | Attribute | Description |
scene | Scene | The main scene. |
|
camera | Camera | The main camera. |
|
lightSource | Object3D | The main light source. |
|
options | Object |
|
The options. See GodRaysMaterial for additional options. |
options.blendFunction | BlendFunction |
|
The blend function of this effect. |
options.resolutionScale | Number |
|
The render texture resolution scale, relative to the screen render size. |
options.samples | Number |
|
The number of samples per pixel. |
options.blur | Number |
|
Whether the god rays should be blurred to reduce artifacts. |
options.kernelSize | Number |
|
The blur kernel size. Has no effect if blur is disabled. |
Public Members
public get blur: Boolean source
Indicates whether the god rays should be blurred to reduce artifacts.
public set kernelSize: KernelSize source
public set samples: Number source
This value must be carefully chosen. A higher value improves quality but also increases the GPU load.
public get texture: Texture source
A texture that contains the intermediate result of this effect.
This texture will be applied to the scene colors unless the blend function
is set to SKIP
.
Private Members
private renderPassMask: RenderPass source
A pass that renders the masked scene over the light source.
Public Methods
public initialize(renderer: WebGLRenderer, alpha: Boolean) source
Performs initialization tasks.
Override:
Effect#initializeParams:
Name | Type | Attribute | Description |
renderer | WebGLRenderer | The renderer. |
|
alpha | Boolean | Whether the renderer uses the alpha channel or not. |
public setResolutionScale(scale: Number) source
Sets the resolution scale.
Params:
Name | Type | Attribute | Description |
scale | Number | The new resolution scale. |
public setSize(width: Number, height: Number) source
Updates the size of internal render targets.
Override:
Effect#setSizepublic update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, delta: Number) source
Updates this effect.
Override:
Effect#updateParams:
Name | Type | Attribute | Description |
renderer | WebGLRenderer | The renderer. |
|
inputBuffer | WebGLRenderTarget | A frame buffer that contains the result of the previous pass. |
|
delta | Number |
|
The time between the last frame and the current one in seconds. |