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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question VFX Submesh Masking (Output Particle URP Lit Mesh Block)

Discussion in 'Visual Effect Graph' started by Duckocide, Jun 4, 2023.

  1. Duckocide

    Duckocide

    Joined:
    Aug 30, 2014
    Posts:
    35
    After spending sometime compiling mesh assets with sub meshes, I've hit a bit of a stumbling block that I hope someone has the answer for.

    I want to change the submesh mask property (to display a different submesh) randomly by particle. As soon as I try to link up a random mask, I get an editor error:

    Can not link a GPU operator to a system wide (CPU) input
    Unable to compute CPU expression for mapping : subMeshMask

    I get the gist of the error (I can't mix GPU and CPU domains operations), but I'm hoping there is a way of selecting a submesh by particle? :(

    VFX submesh mask.png
     
  2. Duckocide

    Duckocide

    Joined:
    Aug 30, 2014
    Posts:
    35
    So a bit of an update on this that I think works. You can of course call the "Play()" method on a VFX to send play event multiple times (spawning more particles). So, if you wait a frame, then change the submeshmask, I believe the fresh Play() adds additional particles to the output using the selected mask. A bit of kludge but I think it works?
     
    Last edited: Jun 5, 2023
  3. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    same here. I want to change the submesh with prticle id.