- Home /
Voxel Mesh has Lines Between the Voxels
I am currently generating a voxel-based mesh via code, ala Minecraft. Each 3D square is a voxel.
The only problem is that I have these lines in-between all of the faces of my cubes and I'm not sure where they're coming from. I've gone through the code and it looks like it's not a rounding error, but, that's about all I can tell.
The only I can think of is that the order of the triangle creation is important, but, that sounds implausible. Or perhaps it's related to the shader or material?
Does anyone have any suggestions on where to start looking?
Here's a video: https://vimeo.com/42994526
Is it possible that it is just the texture? Try removing the material, put on the Default-Diffuse default material
Well, damn. That was exactly the issue. Thank you!:)
So I removed my custom material. Assigned Default-Diffuse and it looks fine. So, it's the Texture/$$anonymous$$aterial.
Now, here's my follow-up question. It's not the texture itself but the texture is from a texture sheet. Could it be a rounding error? The sheet is in increments of 16, so, my UV coordinates are, for example, 15/16.0. This is 0.9375, but, really all I mean is 240. Could that be a problem? It looks like the skybox is showing through the edges of the texture, is why I ask.
Thoughts?
I can give this a shot, though I don't know too much about UVs. Unity is based around using textures at squares of 2, I mean like a 32 x 32 or 64 x 64. I usually go for 1024 x 1024, but a small texture like should be 16 x 16 or 32 x 32.
If it already is, then the only other thing I could think of would be the tiling and offset. I can't see anything else that could be an issue.
The texture and the texture coordinates are powers of 2. Hrrrrrmmmm....
I'll try setting the texture individually rather than from a sheet, but, you'd think that wouldn't matter.
Thanks again for your help.
Answer by squirlhntr · Jun 05, 2012 at 11:24 PM
I figured it out.
The texture that I was using as the material was set up as Filter -> Bilinear. Changing it to Filter -> Point fixed the issue. Sounds like the engine was filtering the texture for me, which was great when it wasn't an edge, but tailed off when it was.
A few lessons learned today! (in addition see the discussion about regarding how to check if your Material is the issue versus the Vertexes)
Your answer
Follow this Question
Related Questions
Artifacts / Stretch Marks in Mesh Manipulation 0 Answers
What is wrong with this mesh editing code? 0 Answers
Can a dynamic mesh be made NOT readable? to save mem 1 Answer
minimize vertex artifacting for procedural mesh manipulations - vertex collision same object? 0 Answers
Could anyone tell me what's wrong with my voxel rendering? 1 Answer