Home Reference Source
import {GodRaysMaterial} from 'postprocessing/src/materials/GodRaysMaterial.js'
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

Constructor Summary

Public Constructor
public

constructor(lightPosition: Vector2, options: Object)

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, options: Object) source

Constructs a new god rays material.

Params:

NameTypeAttributeDescription
lightPosition Vector2
  • optional

The light position in screen space.

options Object
  • optional

The options.

options.density Number
  • optional
  • default: 0.96

The density of the light rays.

options.decay Number
  • optional
  • default: 0.93

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.

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.