Search Unity

Question Point Cache as attribute

Discussion in 'Visual Effect Graph' started by reddotgames, May 15, 2023.

  1. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    Hello

    Is there any way to add point cache file (asset type) as a parameter into VFX graph?
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
  3. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    No, we want to have point cache file as a parameter to VFX graph. So one VFX effect could be used with many point cache files. Right now you can only "hardcode" point cache file into VFX effect.
     
  4. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    76
    Hello,
    Currently point cache can't be exposed properties as they don't have any runtime presentation. On the VFX Perspective, it is a set of textures.
    We might improve this in the future, but in the meantime we recommend exposing a Texture or a Graphics Buffer (or even a mesh) depending on what informations you would like to get.
     
    DevDunk likes this.
  5. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    We are using it for billboard grass positioning with normals. Those are generated from mesh. So it will be hard to convert this informations to texture. For now we will make separate VFX for separate point cache, hoping that some day we can use it as a propertie.
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    Maybe I'm confused, but I feel like what you're asking for is possible and rather simple. Again, unless I'm missing something subtle.

    I have one Visual Effect that moves particles along a bezier curve. To get the control points for the bezier into the VFX, I'm using a Multiple Position Binder, which generates a texture containing the position of all the control points:

    upload_2023-5-27_23-41-11.png

    This Visual Effect is added to a prefab, and each prefab instance can define its own set of control points. Each instance, therefore, creates its own BezierChain texture.

    Is that the sort of thing you're looking for?