Sponsored Adverts

Author Topic: [Unity] two-sided meshes  (Read 1881 times)

0 Members and 1 Guest are viewing this topic.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2187
[Unity] two-sided meshes
« on: July 10, 2015, 02:21:48 AM »
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).


 

Sponsored Adverts
RSS Content is copyright © KatsBits™ 2017 unless otherwise stated. All Rights Reserved.
No part of this web site may be reproduced (except for personal use, or otherwise stated) without prior written permission from KatsBits.com. For more infomation on copyright click here.
Web design cpdtAdvertisePrivacy PolicyDMCA (about DMCA) Home Store Workshops Blog Jobs Support About Katsbits Contact Site Search KatsBits Help Site Map RSS feed Forum YouTube FaceBook LinkedIn Twitter IMVU