Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Getting UV from Point Cache

Discussion in 'Visual Effect Graph' started by PhilSA, Feb 14, 2020.

  1. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,587
    I'm trying to get the uv values from a Point Cache in order to sample a texture with it.

    Right now I haven't found any way to accomplish this aside from this ugly hack of temporary storing the UV in Color, then sampling the texture with color.rg, then setting the real color:


    I guess this works, but it really feels like there should be a bunch of "GetXFromMap" operator nodes (instead of "GetXFromMap" subgraph blocks) so we could do: PointCache -> GetUVFromMap -> SampleTexture2D -> SetColor in the subgraph block

    Is this a planned feature, or are there other ways to accomplish this?
     
    Last edited: Feb 14, 2020
  2. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,587
    Also attempted to reconstruct a UV based on particleID and point count like so, but no success so far



    My guess is that this isn't working because the only methods to generate a dense pointcache over a mesh are random ones ("sequential" is limited to vertex or tri count), and I don't know how to recreate that deterministic randomness?
     
    Last edited: Feb 14, 2020
unityunity