Before I try and reproduce in a PG, let me and try and explain what is happening:
- data streamed via websocket to a client making use of BJS
- data is coordinates (very simple, precision 3)
- one central mesh + LOD meshes are made available and instantiated for when data is received by the client.
- a dynamic “density cloud” is served via websocket too, and results in the creation of a PCS
- a “plane” making use of the BJS GridMaterial is inserted
- …and finally a skybox.
- glow layer + fxaa
The above is not in order, but works nicely.
Until one of the instances is shown “in front” of the PCS and the “plane” and … anything else really. The particles of the cloud are shown “through” the instances. As if the instance wasn’t there (its alpha is always 1 in the color buffer).
Same goes for picking, the instances seem to be non pickable, event after using a code similar to:
instance = mesh.createInstance('i');
instance.isPickable = true;
For those who know better than me (most of you! :)), any low hanging fruit or usual suspect in my brief description above?
I tried making a basic playground to reproduce this but it’s working fine:
Maybe you can mod it to show the issue?
I have added a few things from your PG (thanks for that, btw) and the result is a little bit funny:
Why the switch between yellow and red when orbiting? Not that I know whether it is related to my original problem or not, tbh…
You need to exclude the ground so that it does not block the glow https://playground.babylonjs.com/#HMUYHY#2
thanks, now I need to try and reproduce on a PG, this “I am displayed, at the right position but seemingly behind everything else” issue is still there.
the issue is when I (stupidly?) set the camera’s minZ to a tiny value similar to 0.000000001.
Setting it to something more reasonable (like 0.1) fixes it.
So 100% my fault but would anyone be able to explain the why? thanks.
I suppose we could, but then, what was the question just exactly?
Another thing is, your PG is currently killing my GPU for some reason. I admit I did not investigate (was just passing by ) but when I compare it with the base example delivered by @docEdub , something must be going really wrong here (just saying).
I think line 18 is the problem, with the camera.minZ set to a tiny value.
but maybe other things too. Checking