Skip to content
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

lighting: none does not remove lighting #42

Open
dsinni opened this issue Apr 6, 2018 · 3 comments
Open

lighting: none does not remove lighting #42

dsinni opened this issue Apr 6, 2018 · 3 comments

Comments

@dsinni
Copy link

dsinni commented Apr 6, 2018

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

Using latest version: 1.0.0

@dsinni
Copy link
Author

dsinni commented Apr 6, 2018

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');
      }
    }
    
  });

@florentpeyrard
Copy link

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

@dsinni
Copy link
Author

dsinni commented Apr 13, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants