-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tile generation blue lines #4
Comments
I see the same |
This appears to be a problem with the custom surface shader. The z-fighting seems to suggest it's coloring the triangles with both colors from the nearby biomes. (But why not the water? I dunno.) Anyway, I solved this with the following steps:
var colors = new List<Color> ();
Color[] startCols = { water.startCol, sand.startCol, grass.startCol };
Color[] endCols = { water.endCol, sand.endCol, grass.endCol };
Vector2 uv = GetBiomeInfo (map[x, y], biomes);
// uvs.AddRange (new Vector2[] { uv, uv, uv, uv }); <-- not needed anymore
var color = Color.Lerp(startCols[(int)uv.x], endCols[(int)uv.x], uv.y);
colors.AddRange(new[] { color, color, color, color });
// uvs.AddRange (new Vector2[] { uv, uv, uv, uv });
colors.AddRange(new[] { color, color, color, color });
// mesh.SetUVs (0, uvs); <-- no longer needed
mesh.SetColors(colors); That should do it. |
You're really awesome!! :D |
Lol, I * solved * it a different way. The tiling parameter would cause the graphical artifacts when it was set to <= 1, but if you adjust tiling X in the material to something just slight > 1 the artifacts go away. I suspect it is prevision in the shader, but didn't really dig into it a lot. |
you're awesome |
The text was updated successfully, but these errors were encountered: