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

GodRaysMaterial

Extends:

three~ShaderMaterial → GodRaysMaterial

A crepuscular rays shader material.

This material supports dithering.

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
public get

The amount of samples per pixel.

public set

Sets the amount of samples per pixel.

Public Constructors

public constructor(lightPosition: Vector2) source

Constructs a new god rays material.

Params:

NameTypeAttributeDescription
lightPosition Vector2

The light position in screen space.

Public Members

public needsUpdate: boolean source

public get samples: Number source

The amount of samples per pixel.

public set samples: Number source

Sets the amount of samples per pixel.