Instances - "transparent"(ish) and non pickable


Before I try and reproduce in a PG, let me and try and explain what is happening:

  1. data streamed via websocket to a client making use of BJS
  2. data is coordinates (very simple, precision 3)
  3. one central mesh + LOD meshes are made available and instantiated for when data is received by the client.
  4. a dynamic “density cloud” is served via websocket too, and results in the creation of a PCS
  5. a “plane” making use of the BJS GridMaterial is inserted
  6. …and finally a skybox.
  7. 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?


thank you.

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

1 Like

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.

found it.

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 :slight_smile: but would anyone be able to explain the why? :slight_smile: thanks.

I suppose we could, but then, what was the question just exactly? :face_with_hand_over_mouth:
Another thing is, your PG is currently killing my GPU for some reason. I admit I did not investigate (was just passing by :zipper_mouth_face: :wink:) but when I compare it with the base example delivered by @docEdub , something must be going really wrong here (just saying).

1 Like

I think line 18 is the problem, with the camera.minZ set to a tiny value.

but maybe other things too. Checking :slight_smile:

1 Like

thanks to everyone, this is now fixed and was indeed me having to learn how to read! all good :slight_smile:

1 Like