0
\$\begingroup\$

I'm using a constant seed value for my random number generation, so that results are consistent each load. This example is boiled down to just the height value of the Vector3's I'm using since that's the only value giving me the issue.

Basically at each height level when I do some calcs, the vertices' actual position (stored separately) is jostled by some RNG for a more natural look

...
noiseSeed = Mathf.FloorToInt(position.y) + seed;
...
Random.InitState(noiseSeed);
return new Vector4(Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f), Random.Range(-1.0f, 1.0f));

It's not EVERY vertex having the issue, and there does appear to be some pattern to this as you can see. Given the heights here those same holes will repeat consistently across the face.

I assumed it might be something weird with the floats, but I've debugged and checked the values on both sides, both vertices seem to be generating the same values from the seeds and the resulting calculations leave me with matching Vector3 values.

Is there something else I could be missing in how Unity is handling this?

Note: I'm not having the same issue on horizontal surfaces, those are doing something similar with both X and Z coordinates just fine.

Vertical face of my mesh, with a mismatched vertices called out

\$\endgroup\$
1
  • 1
    \$\begingroup\$ We don't have a minimal complete verifiable example here - there's not enough code for us to reproduce the problem you're seeing in a new, empty project. Please correct that so that users can test potential fixes to be sure they'll work for you. \$\endgroup\$
    – DMGregory
    Jan 7 at 19:54
0
\$\begingroup\$

Those are called cracks. How are you generating the mesh? Are you welding the vertices by using a set before you do the translation? You’ll need the unique vertices so cracks don’t form.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .