Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
clean up init
  • Loading branch information
AdaRoseCannon committed Feb 17, 2021
commit ea0b8427e172495bfab4bfb853bfa2b93c23a2d3
6 changes: 2 additions & 4 deletions src/components/scene/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ module.exports.Component = register('background', {
generateEnvironment: {default: true}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the default to be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's pretty safe and not a huge performance hit as it only renders the once. It will even fix materials unexpectedly not looking right because they expect an environment map. So it's a nice feature, that you only need to type 'background` to get.

I'd even be tempted to take it a step further and make background="transparent:true" a default component on <a-scene> or at least add background to the hello-world boilerplate just to get the better behaviour by default.

},
init: function () {
var cubeRenderTarget = new THREE.WebGLCubeRenderTarget(128, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter });
var cubeCamera = new THREE.CubeCamera(1, 100000, cubeRenderTarget);
this.cubeRenderTarget = cubeRenderTarget;
this.cubeCamera = cubeCamera;
this.cubeRenderTarget = new THREE.WebGLCubeRenderTarget(128, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter });
this.cubeCamera = new THREE.CubeCamera(1, 100000, this.cubeRenderTarget);
this.needsEnvironmentUpdate = true;
},
update: function () {
Expand Down