xml3d / xml3d.js

The WebGL/JS implementation of XML3D
Other
75 stars 25 forks source link

Removing a light from a scene can break updates to other lights #194

Closed csvurt closed 8 years ago

csvurt commented 8 years ago

Removing the last instance of a certain light type (point, spot or directional) can break light parameter updates for other lights in the scene. For example, a rotating spot light will not have its rotation updated anymore.

To reproduce, add two directional lights to the MeshLab example:

<light model="urn:xml3d:light:directional" style="transform: rotate3d(0, 1, 0, -45deg)">
      <float3 name="intensity">0.7 0.7 0.7</float3>
</light>
<light model="urn:xml3d:light:directional" style="transform: rotate3d(0, 1, 0, -45deg)">
      <float3 name="intensity">0.7 0.7 0.7</float3>
</light>

Then remove one during runtime by deleting the element from the DOM. The spotlight should continue to behave normally. Remove the second directional light. The spotlight should now stop rotating. Adding new lights also has no effect anymore.