Search Unity

Declaring array/buffer properties in ShaderGraph or VFXGraph; why not?

Discussion in 'Graphics Experimental Previews' started by PhilSA, Feb 3, 2020.

  1. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,267
    I am not an expert in this, but I often think of situations where I would really want to declare something like a StructuredBuffer in my shaders, or an array of points in VFX Graph. It's often way more convenient than storing data in textures, and very useful for doing stuff with compute shaders, etc...

    Is there a reason why it's preferable not to have the option? Are textures always a better idea? Or would it be too difficult to add this feature?
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,712
    Hardware limitation - StructuredBuffer require SM5 (full support) SM4 (pixel and compute shaders), opposite - textures is basic thing which runs on every shader models and hardwares :)
     
    PhilSA likes this.
  3. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,267
    Thanks for the explanation. I do feel like the HDRP could/should have this feature though, since it kinda has the mission statement of "not being limited by old common-denomitator hardware or tech"
     
  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,712
    Yep, definitely for things like HDRP it'll be good feature
     
unityunity