-
Advanced Member
Frequent Contributor
Stitching adjacent meshes
Hi guys,
What are your favorite methods to stitch separate meshes?
In the following figures I have demonstrated the problem.
Fig.1
Fig.2
The rasterization misses some pixels at the borders. The problem can be overcome by overlapping or rendering additional transition area.
Is there any less expensive method?
Thank you in advance!
P.S. Sorry for the links. They are fixed now.
-
Super Moderator
OpenGL Lord
Re: Stitching adjacent meshes
To my knowledge if the edge has vertices with exactly the same xyzw values, it should not happen.
A workaround is, as a preprocessing step, to "weld" vertices to the same values if they are under some small threshold distance.
-
Advanced Member
Frequent Contributor
Re: Stitching adjacent meshes
Yes, welding is a possible and easy to implement solution, but in a case when meshes are prepared on the CPU. In my case, meshes are generated in vertex or tessellation shaders. Writing values for the bounding vertices in a buffer/texture and reading back is possible, but seems to be an expensive operation since it complicates testing and branching. It has to be applied to all vertices (possible over a million).
The calculation producing the vertices is the same, but probably finite precision makes "negligible" differences that make pixels disappear.
-
Senior Member
OpenGL Guru
Re: Stitching adjacent meshes
I would be more concerned that your tessellation shaders aren't producing consistent results. Is your code designed to produce the exact, binary identical value for boundary interpolated vertices, regardless of which side they're on?
-
Advanced Member
Frequent Contributor
Re: Stitching adjacent meshes
In the example shown above, the geometry is generated in a vertex not in a tessellation shader (please take a look at "Vertex Shader Utilization" equalizer). The values generated by VS are not binary identical. What I can achieve is the relative error less than 10e-5, but obviously it is not enough.
Interestingly, by multiplying values of all calculated coordinates with 1.0001 artifacts disappear on the current machine. But this doesn't mean they wouldn't appear in some other situations.
Is there any way to ensure rounding up for FP calculation in shaders?
-
Super Moderator
OpenGL Lord
Re: Stitching adjacent meshes
It is surprising that your vertex shader does not give the same results for the same inputs.
Can you post it ? Or bissect it to reveal which part makes these small relative errors ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules