fenomas / noa

Experimental voxel game engine.
MIT License
608 stars 86 forks source link

rendering sometimes throws error #156

Closed MCArth closed 3 years ago

MCArth commented 3 years ago

Hi, I'm running my game in prod (yay!) and have included some error logging. Some users seem to be experiencing errors relating to texture etc creation. I think they're coming from webgl returning null, e.g. https://github.com/BabylonJS/Babylon.js/blob/master/src/Engines/thinEngine.ts#L3080

though could be wrong.

A full example stack trace

Error in noa tickloop
 Error: Unable to create texture "
" Error: Unable to create texture
    at t.e._createTexture (https://bloxdhop.io/static/js/3.a6553a74.chunk.js:2:295639)
    at new e (https://bloxdhop.io/static/js/3.a6553a74.chunk.js:2:352012)
    at t.e.createTexture (https://bloxdhop.io/static/js/3.a6553a74.chunk.js:2:296005)
    at new t (https://bloxdhop.io/static/js/3.a6553a74.chunk.js:2:198474)
    at https://bloxdhop.io/static/js/6.7c7bac2a.chunk.js:2:28630
    at https://bloxdhop.io/static/js/6.7c7bac2a.chunk.js:2:28763
    at https://bloxdhop.io/static/js/6.7c7bac2a.chunk.js:2:28780
    at Array.map (<anonymous>)
    at U.build (https://bloxdhop.io/static/js/6.7c7bac2a.chunk.js:2:28258)
    at Object.meshChunk (https://bloxdhop.io/static/js/6.7c7bac2a.chunk.js:2:26831)

These are the errors, though it actually isn't as bad as the numbers make out as I haven't included any throttling - I don't think this is too many users. image

I'm quite inexperienced when it comes to things like this - are these things that'll just happen sometimes, or might it be related to noa?

fenomas commented 3 years ago

Hi, hmm... never seen anything like this. It looks like it's happening well underneath noa - basically it looks like Babylon is asking for textures and vertex buffers and WebGL is saying no. I don't know why that would happen - maybe webGL thinks it's out of memory, or the webGL context has been lost? No idea really...

MCArth commented 3 years ago

It does seem like this is more related to WebGL/babylon (and probably something that'll just happen) so will close this

MCArth commented 1 year ago

I've figured out these are errors from a WebGL context lost which seems fixable for users by refreshing the page

fenomas commented 1 year ago

Hm, if you ever find more details let me know. It sounds like something Babylon should probably detect and give us an error for, I supposed, but it would be nice to sort out.

I've occasionally seen similar errors, but only while I was hacking on the meshing algorithm, so I suspect I was inadvertently triggering undefined behavior in webGL, or something like that.