Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

making a poly surface double sided

Discussion in 'Editor & General Support' started by flapyfox, Jun 27, 2012.

  1. flapyfox

    flapyfox

    Joined:
    Sep 9, 2008
    Posts:
    408
    Is it possible to switch "ON" the double sided attribute of a geometry? I want my animated curtains to be visible from both sides.
     
  2. andorov

    andorov

    Joined:
    Feb 10, 2011
    Posts:
    1,061
    Yes, but you need to write a custom shader with culling turned off. You can use strumpy shader editor to whip one up in < 5 minutes.
     
  3. KzD

    KzD

    Joined:
    Dec 31, 2011
    Posts:
    52
    I'm personally having a issue with culling all the time.
    Is there a easy way to set up unity to avoid this!?
    Im building alot of house type models for a FPS and run into the culling issue from the inside of my meshes often.
    I'm using c4d R12.
    Any suggestions?
     
  4. Tct1856

    Tct1856

    Joined:
    Jan 22, 2010
    Posts:
    104
  5. i3DTutorials

    i3DTutorials

    Joined:
    Aug 26, 2010
    Posts:
    564
    It'd be easier for you to simply make the mesh double sided in your 3D app- takes literally about 5 seconds.
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Making the mesh double-sided is the way to go; turning off the backface culling with a shader doesn't really work because the lighting on the back side will be the same as the lighting on the front side, which is wrong in most cases.

    --Eric
     
  7. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    I can only affirm this. Just make the mesh itself double-sided and don't touch the shader for this purpose.
     
  8. flapyfox

    flapyfox

    Joined:
    Sep 9, 2008
    Posts:
    408
    my problem is that I have many curtains in my scene, and I already reached my poly limit, so duplicating each skinned curtain twice is not an option. I just wanted to know if it was possible to do that in the inspector, per object bases like in Maya where you just tick ON or OFF "double sided" in the object's inspector, but it seems it's only doable via coding a shader in Unity.
     
  9. KzD

    KzD

    Joined:
    Dec 31, 2011
    Posts:
    52
    Does anyone know how to turn on doubles used polys is C4D R12
     
  10. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    I guess this doesn't work, because Unity uses another shader ( I don't know about that stuff yet ). I'd just try copying the shader and turning off the backface culling. If it affects any lightning and doesn't look statisfying you could try reducing some polys or so
     
  11. moctezumagames

    moctezumagames

    Joined:
    Jun 9, 2009
    Posts:
    395
    Double sided shader will not "invert" the triangles and make your mesh magicaly double sided. For the GPU a double sided mesh is just 2x polycount, it will make the rendering twice for that material.
    So again, the best way is to duplicate and flip your triangles.

    even more clear: double sided shader IS NOT an optimization, it's just worse in everything.
     
    yukisoulme likes this.
  12. flapyfox

    flapyfox

    Joined:
    Sep 9, 2008
    Posts:
    408
    alright, makes sense now.
    thanks for the info everyone,
     
  13. TIGGYsmalls

    TIGGYsmalls

    Joined:
    Jan 10, 2013
    Posts:
    38
    Ok, so I'm trying to make a muzzle flash, the poly object is double sided in Maya but after the import its single sided like everything else you import into Unity.

    Is there an option in the Inspector in Unity to change these settings?
     
  14. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Are you sure thats its double sided in Maya ? or its just shown double sided in Maya ?
    Turn off the "show double sided" option in Maya to get sure that its relay double sided.