Search Unity

Creating double-sided polygons in Blender

Discussion in 'Asset Importing & Exporting' started by Jessy, Feb 5, 2010.

  1. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Creating a polygon with a reversed normal is easy enough: Duplicate the face, Flip Normals on it.

    But that's not reusing vertices. Blender doesn't seem to want to let me create two faces, using the same vertices. What should I do? Just merge all but one of them?
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    That would be a very time consuming solution. As far as I know it is not possible to have two faces that share the same vertices (a very good place to ask that would be blenderartists.org). There is probably no easy solution for that in Blender.
    I expect you have already though about using a shader with Cull Front and then Cull Back, as it uses two passes.
     
  3. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    I disagree. I've never gotten a single response to anything, there. I don't waste my time anymore.

    It doesn't use two passes, if you use Cull Off. Also, that's not what I need, because not every polygon needs to be doubled.
     
  4. GusM

    GusM

    Joined:
    Aug 27, 2005
    Posts:
    585
    You can use a separate mesh including only the polygons you want, and set it to doublesided in Blender. Then in Unity you will need also a separate shader for it, vegetation two pases unlit works very well for me.
     
  5. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Despite what was said by scenery twiddler here, neither Doublesided nor Twoside have any effect in the fbx file. Have you had a different experience? I just tested with Blender 2.49b.

    http://forums.x-plane.org/index.php?showtopic=30552

    I just looked at that shader, and it's got two problems. One, it's not good for the iPhone, because it uses alpha testing. The second, is that it renders the backfaces even though you don't see them. Using a shader without backface culling makes geometry just slightly faster to create, but that is matched with lesser in-game performance (or if the performance isn't noticeable, extra waste of battery).
     
  6. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    If you want a face with two sides and correct lighting then you can't share vertices since each one needs a unique normal to calculate the lighting properly. There are no special tricks to get around this... duplicate the faces and flip the normals ;)
     
  7. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Don't need lighting! :)
     
  8. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Well, ok, then your idea to weld all the vertices except for enough to avoid lamina faces or non-manifold geometry would probably be best if you're trying to squeeze out every last vertex to it's fullest potential. Seems like a headache though and something that would be very easy to screw up depending on the amount of faces you have to do this to. Make sure it's worth squeezing those vertices so much ;)
     
  9. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    I've come to the same conclusion about it not being worth the trouble. I admire your work, so I'm glad to hear the same from you! But it's lame that it's not even possible. :cry:
     
  10. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    666
    FYI Jessy, I know this is years late, but the actual solution to your problem is to do as you originally suggested, then while in Edit Mode, select all, go Mesh -> Vertices, Remove Doubles.

    Nice and simple! Although...now I look at it, the mesh uses the normals stored separate and they are per vertex, not per index...so doing this will remove one of the faces...doh!

    So basically for double sides you need double vertex, purely because of how the normal data works!
     
    Last edited: Aug 30, 2013
  11. JGwinnerFree

    JGwinnerFree

    Joined:
    Feb 22, 2019
    Posts:
    1
    I first did VR back in the days when every poly did count ... I had a train with 6 polys. RenderWare offered a 'double sided' flag on the polys.

    Those days are long gone, lol.

    == John ==