aframe-environment-component icon indicating copy to clipboard operation
aframe-environment-component copied to clipboard

`lighting: none` does not remove lighting

Open dsinni opened this issue 6 years ago • 3 comments

Setting lighting: none doesn't appear to remove lighting from the scene.

Using latest version: 1.0.0

dsinni avatar Apr 06 '18 02:04 dsinni

For those having the same issue, I wrote a simple component to remove the lighting from the environment. Just add it to the entity that uses the environment component.

Entity:

<a-entity environment="..." remove-lighting></a-entity>

Component:

  /**
   * Remove stubborn lighting from environment
   */
  AFRAME.registerComponent('remove-lighting', {
    
    dependencies: ['environment'],
    
    update: function() {
      var lights = this.el.querySelectorAll('[light]');
      
      for (var i = 0; i < lights.length; i++) {
        lights[i].removeAttribute('light');
      }
    }
    
  });

dsinni avatar Apr 06 '18 18:04 dsinni

I do confirm the issue, as well as the workaround being effective, thanks @dsinni !

florentpeyrard avatar Apr 13 '18 14:04 florentpeyrard

No problem, @florentpeyrard. Glad it worked out for you.

dsinni avatar Apr 13 '18 18:04 dsinni