Reference count has underflowed while browsing complex materials

After several tries, i suspect the rendering of the textures (samplers) is causing this issue. In most cases if texture samplers are moving into the visible area an error or crash is triggered. May not happen for the first few but at some point it starts…

So yes, try to move the texture samplers to functions. I bet it works then…