Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Cubemap in IBufferElementData

Discussion in 'Entity Component System' started by alexandre-fiset, May 24, 2019.

  1. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    714
    Quick question: Since I can't pass a cubemap into IBufferElementData, what would be the recommended alternative?

    Code (CSharp):
    1. ArgumentException: DaytimeSystems.DaytimeReflectionProbeBuffer contains a field of UnityEngine.Cubemap, which is neither primitive nor blittable.
     
  2. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    So what you could do is have hybrid gameobjects with a MonoBehaviour that has the sole purpose of holding the Cubemap reference, then have those objects referenced in a lookup. Incurs some redirection but wouldn't be too bad, and if/when the promised changes to support POCO reference types as components happens you can easily switch it for a better or more direct alternative.