Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 11

Thread: Stitching adjacent meshes

Hybrid View

  1. #1
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    947

    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.

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    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.

  3. #3
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    947

    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.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,723

    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?

  5. #5
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    947

    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?

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    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
  •