xeolabs / xeogl

A WebGL-based 3D engine for technical visualization. Not actively maintained.
http://xeogl.org
Other
1.15k stars 264 forks source link

Fixed a bug that caused renderers to be shared between canvases. #246

Closed Artur-Sampaio closed 6 years ago

Artur-Sampaio commented 6 years ago

Unfortunately you cannot (yet) share resources across contexts on WebGL.

For instance, an object from a canvas 'B' that is assigned a material with similar characteristics, in similar scenes, to another previously created in canvas 'A' would attempt - and fail - to use the renderer from 'A', since the hash (built using rendering caracteristics) would match.

Adding the canvas id to the hash solves this issue, forcing canvases to hold the entirety of the data they need when rendering.