Single Entity
Single Entity

Reputation: 3123

How to use Deferred Lighting in Three.js

A current Three.js application I am developing requires a lot of independent lights and so would benefit from a deferred lighting renderer.

Resources I have so far read on this suggest using WebGLDeferredRenderer, however when I define a renderer object as they suggest:

var renderer = new THREE.WebGLDeferredRenderer({
width: window.innerWidth,
height: window.innerHeight,
scale: 1, antialias: true,
tonemapping: THREE.FilmicOperator, brightness: 2.5 });

and call the renderer as follows to draw the scene:

renderer.render( scene, camera );

I get a blank screen, whereas if I use the standard WebGL renderer my scene is correctly rendered.

 renderer = new THREE.WebGLRenderer( { antialias: true } );

I can't seem to find a suitable example of implamenting deferred lighting in three.js. Am I missing a library? I only have three.js linked. perhaps this requires an additional library?

In my clone of three.js I can't find a copy of WebGLDeferredRenderer.js.

Upvotes: 1

Views: 4209

Answers (1)

WestLangley
WestLangley

Reputation: 104833

WebGLDeferredRenderer has been removed. See this post for more information, and follow the links to access the old code.

three.js r.73

Upvotes: 3

Related Questions