0

I see a very strange visual effect in my custom game engine's voxel rendering. I know it is very difficult to debug this sort of thing with just a video but I was hoping someone would recognize the effect and know what might be causing it.

You can see the effect in this image, as well as the video linked below.

Image

Video

It looks like the geometry wobbles around as the distance from the camera to the geometry changes, until the camera gets close enough and it stops.

For context the engine splits the world into 32x32x32 chunks. Each chunk is rendered as a single mesh. The mesh is generated by making a quad (two triangles) for each exposed side. I am using Vulkan for rendering, through the Veldrid library.

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 1
    If you are using Vulkan, why did you tag the question with OpenGL? – user253751 Jun 25 '20 at 10:35
  • I thought that the opengl tag would be more common and the issue probably isn't graphics API specific. I could be wrong. – Declan Easton Jun 25 '20 at 19:07
  • Now I've watched the video and I agree this doesn't look graphics-API-specific. It looks like a Móire pattern. What is the texture on the voxels? – user253751 Jun 25 '20 at 20:17
  • I am using [this](https://github.com/generatives/Wrecker/blob/master/Wrecker/Assets/spritesheet_tiles.png) spritesheet from Kenney assets. I am using [this](https://github.com/generatives/Wrecker/blob/master/Wrecker/Assets/spritesheet_tiles.xml) data to calculate texture offsets for rendering. – Declan Easton Jun 25 '20 at 23:58
  • After googling around a little for the Móire pattern, it seems like I might need to look into mip mapping and MSAA. Does that seem like a good direction to go? – Declan Easton Jun 26 '20 at 02:04
  • Mipmapping yes, MSAA no. Your spritesheet link is broken. What is the texture on the voxels? – user253751 Jun 26 '20 at 10:01

1 Answers1

0

I think I may have found a solution. After looking around I found some information on this post which mentions z-fighting. I had my near plane distance set to 0.05 and my far plane set to 2048, a very large distance. Moving the near plane forward and the far plane back helped a lot. I might look into dynamically setting the distances based on the geometry being rendered.