See also

  • In addition to being easier to write, swizzling, smearing, and masking properties have performance benefits as well
  • However, inappropriate use of swizzling can also make your code harder to understand at first glance, and may make it harder for the compiler to automatically optimize your code
  • Packed arrays are one of the nicest features of Cg. You can discover more about them here: http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter02.html

Get Unity 2018 Shaders and Effects Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.