Three.js: Calling cubeCamera.clear(renderer) generates warnings/errors

Created on 1 Mar 2019  ·  3Comments  ·  Source: mrdoob/three.js

Description of the problem

Calling

var cubeCamera = new THREE.CubeCamera(0.1,1000,256);
cubeCamera.clear(renderer)

generates a warning about .activeCubeFace now being a parameter on setRenderTarget and then generates subsequent webGL errors. This looks like the CubeCamera code hasn't been updated to reflect the new behavior, as the next line in the function calls

renderer.setRenderTarget( renderTarget );  : three.js line 40194

But doesn't pass the activeCubeFace as the second parameter.

I made a local copy of the library and changed the offending call site to:

    //renderTarget.activeCubeFace = i; //Don't do the bad thing..
    renderer.setRenderTarget( renderTarget, i ); //Do the right thing...

and that seems to fix it.

https://jsfiddle.net/manthrax/gutwrs90/2/ <----r102 repro
https://jsfiddle.net/manthrax/ehfjkvxq/ <---- dev branch repro

Three.js version
  • [x] Dev
  • [x] r102
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)

all

Bug

All 3 comments

Thanks. Would you like to file a PR and fix it?

Damn, this method was missed in #15808. It needs basically the same fix like CubeCamera.update().

I think that PR is what is needed. Let me know if I'm missing something..

Was this page helpful?
0 / 5 - 0 ratings