alexoy Posted June 10, 2018 Share Posted June 10, 2018 Hi, Probably there is a bug in occlusion queries - http://www.babylonjs-playground.com/#QDAZ80#15 Here a label is a thing that appears/disappears depending on the visibility of a sphere. I've noticed Occlusion Query takes into account only meshes that were created before it was enabled. If I add a box later - BJS doesn't understand that a sphere is behind the new box and my label stays visible. In my demo - in the beginning the label is not visible because the sphere is not visible, it's good. However, if you go to the right behind the box - label will always be visible. Is it normal and can be configured somehow or it's a bug? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 11, 2018 Share Posted June 11, 2018 Hello I'm glad to say that this is not a bug By default opaque objects are rendered in creation order but you need them to be rendered front to back if you want to leverage occlusion: http://www.babylonjs-playground.com/#QDAZ80#16 (see line#53) alexoy 1 Quote Link to comment Share on other sites More sharing options...
alexoy Posted June 11, 2018 Author Share Posted June 11, 2018 @Deltakosh, thanks, it helped and 2 new questions.. 1. Of course about performance differences - will there be? Static list of meshes vs dynamic. Will it be reordered on every frame? (noticeable with a big enough list?); 2. For modelling I use Blender. When I set a texture on a mesh - there is a texture's setting whether to use "Alpha" or not. If I set "Use", even if my image is not transparent at all - occlusion queries say the label is still visible. If I uncheck "Use" - everything is fine and the label becomes invisible when behind this mesh. Is this an expected behavior? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 11, 2018 Share Posted June 11, 2018 1. It will on every frame but sort are pretty fast now on browsers 2. Yes as you are no more creating an opaque mesh but a transparent one which will not be processed by occlusion queries Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.