-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular dependency in WebGLCubeRenderTarget.fromEquirectangularTexture #19137
Comments
As far as I understand, this circular dependency is not harmful. However, circular dependency is always an indicator that something with the class design is not right. This issue can only be solved by refactoring. I've already though about this in the past and my preferred option is to inject the internal render target of var camera = new THREE.CubeCamera( 1, 1000, 256, { format: THREE.RGBAFormat, magFilter: THREE.LinearFilter, minFilter: THREE.LinearFilter } ); we do this: var renderTarget = new THREE.WebGLCubeRenderTarget( 256, { format: THREE.RGBAFormat, magFilter: THREE.LinearFilter, minFilter: THREE.LinearFilter } );
var camera = new THREE.CubeCamera( 1, 1000, renderTarget ); I like latter one since the last two parameters of |
Yeah, that looks better to me. Passing in parameters intended for the render target to the |
If @mrdoob approves (and consider no other objections), I can make a PR with the change. |
I've already made the PR so it's easier to see the changes. |
@Mugen87 Thank you! I'll review this week. |
@mrdoob /bump |
The last circular dependency in the library is:
WebGLCubeRenderTarget -> CubeCamera -> WebGLCubeRenderTarget
This is caused by
WebGLCubeRenderTarget.fromEquirectangularTexture
, which was added in #16671 following discussion in #15331 (comment).This is the last blocker for closing #6241.
To remove this, we could extract
.fromEquirectangularTexture
to an external utility (or maybe move it toCubeTexture
?). I'm not sure if it's worth doing so just to avoid a circular dependency though.@WestLangley, @Mugen87 and @mrdoob - you guys were involved in adding this method. Do you think we need to fix this circular dependency? If not, then we can probably just mark as "won't fix" and close #6241.
The text was updated successfully, but these errors were encountered: