I’m making a voxel game. So, i use my own algo for optimize and improve the fps. For information, I use shaders.
I have the rendering that i want, but in distance I have a freaky bug. See the http://www.noelshack.com/2015-12-1426533011-screenshot.png
As you can see, there are some brown lines between the chunks. But when I walk towards them, they retreat, I don’t understand why… Could you help me ?
A similiar result happens when you use a texture atlas and the magfilter picks some pixel from the next texture, but it can’t be your case unless you are using a single uvmap for the entire chunk.
Could you post the fragment shader?
If you fill m_dataBlocs with a solid color the lines are still present? And if you set the MagFilter to MagFilter.Nearest and the MinFilter to MinFilter.NearestNoMipMaps?
The MagFilter and the MinFilter are still set to MagFilter.Nearest and to MinFilter.NearestNoMipMaps. But if I fill m_dataBlocs with a solid color the lines disappear ! Have you any idea to explain it ?
Could you explain a bit what you are doing in your code? For example, what is m_data and why you divide vector.x for 11?
Also, this is quite OT but, for performance’s sake, you shouldn’t use two while cycles for make vector.x equals to color.x…
…because that’s at the edge of the ‘cell’ in the atlas… you are picking up the neighboring cell at the edges. I don’t know how else to explain it really as this is an extremely common problem with texture atlases. I mean, we’re assuming that you are using an atlas anyway.
Otherwise, I see lines even in the foreground perhaps the farground lines are just the grossly foreshortened version… but more likely it’s a texture atlas bleeding problem. You can probably google search “texture atlas bleeding” to get an overview of the issue in your code.
Its a little hard to tell, but to me it seems your shader is selecting the brown texture at the edges of the blocks for some reason. Why its doing that, well, that’s a question for you, because you wrote the shader?
Unless your chunks are cell-sized then it doesn’t exist only between the chunks as it’s clearly between every cell in some cases. So maybe you need to define the terms you are using.
You probably say I’m crazy, but maybe there is two bugs : the lines between the chunks and the white points. Because on the first screenshot I sended we don’t see the white points…