Search Unity

Getting UV from Point Cache

Discussion in 'Visual Effect Graph' started by PhilSA, Feb 14, 2020 at 9:34 PM.

  1. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,257
    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 at 9:52 PM
  2. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,257
    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 at 11:06 PM
unityunity