KatsBits Community

[Unity] two-sided meshes

kat · 1 · 12811

0 Members and 1 Guest are viewing this topic.

Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2720
    • KatsBits
Unity renders only the outside of a mesh

Unity, like most game engines, renders meshes single-sided by default because it's the cheapest way to display an object. Technically meshes are always single-sided unless the engine is instructed to duplicate and mirror surfaces. Drawing mesh data this way is often global; it's either 'on' of 'off' for everything so not easily controllable per-model, and it uses significant resources to perform (load mesh » read mesh » duplicate structure » flip structure » render to screen). Because some models do need to be double-sided its more effective to disable two-sided rendering in favour of using more individualistic approaches. This can be done in by;
When to use which option
Option "2" works best with simple models or selections/assignments made from reduced numbers of faces, so creating a basic planar windowpane would simply mean duplicating and inverting faces per two-sided requirements. More complex or numerous objects may benefit from option "1"; grass sprites for instance where there is a need to render a lot of double-sided surfaces. Care has to be taken to not waste too much in the way of CPU, GPU or memory resources associated with 'overdraw' and 'fill rates', in addition to lighting issues - both sides are illuminated the same way so the reverse side may appear lit when it should be shaded (more complex shaders are required to solve this).