richardbiely / Voxelmetric

An efficient voxel framework for Unity3d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TexturedBlocks example has some kinda of problem with texture tilling on "merged"/optimized mesh parts

HugoJF opened this issue · comments

Just loaded the textured example and I saw this: https://i.imgur.com/qqwJQW8.png

Running on 2017.1.1f1.

I'll try to dig the cause of this but I have no idea what's happening yet haha.

This is a known issue. An update shader / texture arrays are needed to make the texture repeat instead of stretch.

is there any known way to fix this bug even with a cost of a little performance lost?

commented

Hi Andrew,

This bug is caused by a greedy meshing algorithm that is used to reduce the amount of vertices and triangles that are rendered by the GPU. When applying textures, it does not take into account these faces that are built which causes them to appear stretched.

There are a few solutions to this problem. Texture arrays, instead of a texture atlas, can be used to store our textures. Secondly, a shader can be used. Lastly a texture id can be used in the greedy meshing algorithm so that it knows not to merge faces that have different textures.

Hope this helps :)

Are there any practical implementations? Did you managed to solve it?

commented

All of those suggestions have been used in other voxel engines. I have not solved this issue myself, it's something I plan on doing, but not a priority for me at the moment.

Here are a couple links I've bookmarked regarding the methods I've mentioned for further reading.

Applying an offset to fragment shader

Great article on this problem, shows how to do wrapping and filtering to solve this. Mentions texture arrays as well