Home Unity

snap geometry and flashing white pixel

Zijk814.png

Geometry is snapped in unity but when I rotate the view in play-mode, randomly appear some white pixel. Some idea to solve this issue?

Replies

  • MikeF
    Options
    Offline / Send Message
    MikeF polycounter lvl 19
    have you tried putting a texture on it?
    sometimes the un-altered default materials will produce weird artifacts like that
  • Luxxa
    Options
    Offline / Send Message
    here with texture:

    dumaRal.png
  • Brendan
    Options
    Offline / Send Message
    Brendan polycounter lvl 8
    As it seems to only happen at the breaks between pieces, it would probably be a depth-related issue.

    Can you post the near and far clip planes of the camera used? (if this is happening in scene view only, you won't need to worry).

    Always try to keep the near clip plane as large as possible; Unity doesn't do depth in a linear way, the advantage being if you can push the near clip plane from 0.1 to 0.2, you'll get sampling that's twice as good for 4 times as far.

    Same with the far clip plan; if possible, avoid setting it to more than a few hundred meters. One thing you can try if you need is a second camera for the further depths (say 500m to 5000m), set the close camera clear flag to 'depth' and the far camera to 'skybox' or whatever.


    Or, you know, add some faces around the edges as padding. These can be useful for corner pieces as well because they can be made to line up at 90 degrees. Also they're good for preventing light leaks if you can get away with lower res shadow mapping.
  • Luxxa
    Options
    Offline / Send Message
    Brendan wrote: »
    As it seems to only happen at the breaks between pieces, it would probably be a depth-related issue.

    Can you post the near and far clip planes of the camera used? (if this is happening in scene view only, you won't need to worry).

    Always try to keep the near clip plane as large as possible; Unity doesn't do depth in a linear way, the advantage being if you can push the near clip plane from 0.1 to 0.2, you'll get sampling that's twice as good for 4 times as far.

    Same with the far clip plan; if possible, avoid setting it to more than a few hundred meters. One thing you can try if you need is a second camera for the further depths (say 500m to 5000m), set the close camera clear flag to 'depth' and the far camera to 'skybox' or whatever.


    Or, you know, add some faces around the edges as padding. These can be useful for corner pieces as well because they can be made to line up at 90 degrees. Also they're good for preventing light leaks if you can get away with lower res shadow mapping.
    Clip plane value: 0.1 to 1000 (I use first person controller). I had tried for the near 0.2 ; 0.4 : 1.0 and 100 ; 500 for the distant plan, but nothing change.

    I noticed that happen when there is something bright behind (example a white floor).
  • Elyaradine
    Options
    Offline / Send Message
    Elyaradine polycounter lvl 11
    Hi Luxxa.

    I FEEL YOUR PAIN. I've generally been the artist that has to go around fixing all of these any time they happen -- and they happen terribly often, especially when you're working with modular geometry.

    The cause of the flashing dots is, supposedly, t-junctions. (i.e. Edges that are snapped together, but where vertices don't meet perfectly, forming a shape that looks like a "T".) Unfortunately, often I found that I was certain I _had_ vertices wherever these were snapping, and I'd see the flashing white dots anyway, and I think there are a few possible causes.

    The first possibility is that it's a loss of precision when working with rotated meshes. Since Unity does everything behind the scenes using quaternions, the angles we'd normally use (e.g. 90, 180, 270 degrees, and excuse the maths pun) end up as what seem to be irrational numbers. Sometimes, when I find it's impossible to have a mesh at exactly 90 degrees; after I enter the "90", I'll find that it's changed itself to 90.0001, or something along those lines. I believe that sometimes this rounding error caused by the conversion between euler and quaternion coordinate systems causes the verts not to be snapped properly sometimes. If this is the problem, I honestly have no idea how to work around this other than having another set of meshes for things that are rotated.

    The second possibility is that it could be imprecision caused by scale. If you're far into your project, ouch. Otherwise, try exporting your meshes from your 3D app as either 100x larger or smaller, and see if it still happens.

    Then, check in your 3D app and make 100% sure that all the verts really are snapped together on the edges where your meshes meet. I found that sometimes when I zoomed in really close, I'd find that the verts actually didn't have the same positions. I'm sure my colleagues wouldn't do this on purpose, but it surely happened _somehow_.

    I've also found that sometimes, even using the snapping tool to snap verts together in the 3D app I'd get the flashing, whereas merging everything together, welding all the verts, and then breaking them apart again seemed to get rid of them. I have no freaking idea why, but in my experience... it worked.

    These fix a lot of them, but not all of them. I've resorted to just going and not using tiny modular pieces, and instead merging them together into larger chunks when there's a problematic area.

    I hope you come right. It's incredibly frustrating.
  • Luxxa
    Options
    Offline / Send Message
    Yes, I had noticed that snap in 3d app non is 100% reliable, so I don't use it; instead I have move and extrude everything using numerical input. This give me a perfect alignmen in 3d app even at greatest zoom. With this metod the bad split are gone, but I have this evil pixel yet.

    Changing scale not solve the problem
  • Farfarer
    Options
    Offline / Send Message
    This is really hard to get rid of without extra geometry.

    Just extend the edges of your modular pieces back a little way and that should hide your gaps.
  • Luxxa
    Options
    Offline / Send Message
    Farfarer wrote: »
    This is really hard to get rid of without extra geometry.

    Just extend the edges of your modular pieces back a little way and that should hide your gaps.
    Thank you, it work! :D!
  • Elyaradine
    Options
    Offline / Send Message
    Elyaradine polycounter lvl 11
    Ha, awesome.

    I couldn't do that on our geometry because it resulted in the lightmap bake picking up the intersecting edges and giving me shadows along the seams.
Sign In or Register to comment.