Skip to content

WebGLRenderer.render() should respect previously set render target #15420

@maccesch

Description

@maccesch

A little while ago clearRenderTarget() was (rightly) deprecated because it internally changed the render target. Now you have to do it explicitely:

renderer.setRenderTarget(target);
renderer.clear();

This makes the internally used concept of a state machine more clear.
But by that logic a call to render() should use the current render target as well:

renderer.setRenderTarget(target);
renderer.render(scene, camera);      // should render to target

But that doesn't work because of this line:

this.setRenderTarget( renderTarget );

Right now it only works like this:

renderer.setRenderTarget(target);
renderer.render(scene, camera, target);

Please let me know what you think. I'd be happy to submit a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions