Weird pixelized coloring near camera

Okay will do, but how would I do it differently than what’s already being done here?

Should I just be removing the extra clones?

Here’s the same playground using just one instance:

You should really setup the repro as close as possible to the live link:

  • fog is enabled
  • scene.useRightHandedSystem = true
  • the grass mesh (grass_1_EEGridSourceMesh[9][6]) is using thin instances, not instances
  • the grass mesh transformation is not the same. In the live link, scaling=1/1/1 and there’s no rotation. Also, the mesh is not parented
  • using directional light instead of hemispherical
  • not the same parameters when creating engine
  • use a clear color with alpha value

I tried to fix these differences in this PG:

It still works in the PG. Can you try to use the latest Babylon.js version in the live link? Also, there are some CSS in the live link which does not exist in the PG, maybe try to remove them as much as possible. Removing all objects except the grass in the live link will also help debugging as there will be less objects to deal with.

1 Like

Ok, I could reproduce, that’s because of the very big values you have for your world extent:

Precision is lost because of that, leading to the artifacts we can see on the grass.

See Floating Origin (Huge Scenes Support) | Babylon.js Documentation in the documentation. I think there have been a number of posts in this forum about this subject too.

3 Likes

Wow! I wouldn’t have thought that loss of precision affects the shading of a scene, I thought it was something that effected mesh positioning and such. That is really spot on debugging. :dart: Thank you so much.

See Floating Origin (Huge Scenes Support) | Babylon.js Documentation in the documentation. I think there have been a number of posts in this forum about this subject too.

I was starting to read about that after seeing an interesting thread here on the forums the other week lol. I’ll head back and read about this a bit more in depth. Thanks again for your assistance. This technique of delegating one source mesh per grid zone to govern a large collection of thin instances is a really neat trick, and works really well for me.

2 Likes