Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. 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,926
    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,926
    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
  3. Ofenkatze

    Ofenkatze

    Joined:
    Aug 14, 2013
    Posts:
    15
    Did you ever find a solution to that particular problem?