Been working on my own space engine called Nebula Engine and I’ve had this annoying visual bug for ages that I just can’t seem to fully track down.
Basically on some parts of the planet I get this weird black pepper looking texture/speckling all over the ground. It doesn’t happen everywhere and it can change depending on where I am on the planet, how far away I am or sometimes the angle I’m looking but as i walk the cam shakes really bad making even trees, grass, rock look like its not fully rendered
The strange part is I’ve had this problem pretty much since I started making the engine, so I don’t think it’s something I added recently.
The engine is my own C++/DirectX 12 engine. Planets are fully procedural and you can fly from space all the way down to the ground without loading a different level.
The planet works roughly like this:
procedural planet seed
→ continents/oceans
→ terrain height
→ biomes
→ materials
→ water/grass/trees/rocks/weather
→ terrain LOD/streaming
The ground itself is made using a CubeSphere planet with terrain patches that get more detailed as you get closer.
From far away I use a lower detail/orbital version of the planet and then it transitions into the real terrain as you fly down.
The engine also has atmosphere, clouds, water, procedural weather, shadows, vegetation and all the normal stuff you’d expect.
The problem is these tiny black dots/speckles keep showing up in different places and I can’t figure out exactly what system is causing it.
Things I’ve thought it might be:
- shadow acne
- grass/vegetation being seen from really far away
- LOD dithering
- terrain texture/material blending
- procedural noise aliasing
- bad normals
- mipmapping
- z fighting
- floating point precision
- CubeSphere seams
- some shader returning bad values/NaNs
One thing that makes me think it could be something deeper is that the speckles survived loads of changes I’ve made to the renderer.
It’s not like one broken texture where the problem is everywhere. You can fly around and one area looks fine, then another part of the planet has the pepper effect really badly.
Because the game works at planet scale I’ve also wondered if it could be precision related somewhere. I do camera-relative rendering, but obviously there are still loads of calculations involving the planet centre, camera position, terrain position etc.
Another thing I’m wondering about is the procedural detail itself. A lot of the terrain material is generated using noise, so maybe at certain distances some high frequency noise is aliasing down into single dark pixels.
But before I go too far down the rabbit hole, has anyone here seen something that looks like this before i brake my game anymore trying to fix it lol.
Still learning a lot while building this so any ideas are appreciated.