Search Unity

VFX Graph won’t render Set Position from Map if VFX Window is not open in Editor

Discussion in 'Visual Effect Graph' started by Elliott-Mitchell, Apr 20, 2021.

  1. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    VFX Graph won’t render Set Position from Map if VFX Window is not open in Editor -> If the vfx asset has been opened in the editor and then closed.

    ▪ MacOS
    ▪ Unity 2020.3.3f1
    ▪ URP 10.4
    ▪ VFX Graph 10.4

    I figured out a emergency workaround :
    Go to Preferences -> Visual Effects -> Force Compilation in Edit Mode. Toggle this on. If it is already on, toggle it again. Only then will the particles will display and build. This has to be done every time the graph is opened in editor!

    Took me hours to figure this out.

    Bug or feature?
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @Elliott-Mitchell ,

    Can you share a screenshot of your graph or a gif/video demonstrating the issue?
    (or otherwise log an issue and we can take a look)

    Cheers!
     
  3. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    Hi @VladVNeykov,

    Here is a screenshot of the graph - it's simple. And here is a link to a video (it's too large to post on the site).

    Thanks!

     
  4. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    Added materials in post above, thanks!
     
  5. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    Submitted Bug Case (1331056)

    EDIT: This is happening when on iOS Platform in Build Settings (not Mac Platform settings)!


    ▪ MacOS computer with editor set to iOS Platform
    ▪ Unity 2020.3.3f1
    ▪ URP 10.4
    ▪ VFX Graph 10.4

    I'm working on an extremely time sensitve project and need to know if I should switch versions of Unity and/or URP ASAP.

    Thanks!
     
  6. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @Elliott-Mitchell ,
    Thanks for filing a bug, we'll take a look.

    From your video, I see you have ticked all of the preferences. Many of them are for debug purposes, do you have a strong reason for needing them all on? The experimental blocks and the additional debug info are helpful for every day use, but if you don't have as reason for having the last 3 on, I'd recommend turning them off (which seems to also solve your issue).


    But either way, the team will take a look at the issue you filed, thanks!
     

    Attached Files:

  7. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    Thanks for a quick reply!

    I turned them all on while troubleshooting the bug. When set to iOS platform (on a Mac), unchecking all the boxes makes no difference. I still need to toggle on Force Compilation in Editor Mode.

    Please check out the project I submitted. Thanks again!
     
  8. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hey @Elliott-Mitchell ,

    I took a look and it indeed looks like an iOS bug.
    We have a task on the public roadmap for adding mobile support for compute-capable devices, so thanks for logging this, we were not aware of this issue.

    Until a fix is made, as a workaround I observed that the issue only happens in Initialize, so you can potentially move the Position from Map block down to Update or the Output.


    If you move it to Update, you should change the Sample Mode to Random Constant, so particles get the same position each frame. This won't work with your gravity, however.

    If you move it to Output, just change your block's composition from Overwrite to Add and remove the sphere position in Initialize, and it should work with the gravity as well.

    This is what the min. graph change will look like for the Output workaround:


    You can by the way emulate closing the VFX window by forcing the graph to use runtime shaders even if the VFX window is open (by default if the graph is open it uses an "edit mode" set which allows you to modify values and see the changes. The runtime mode is the optimized one that's doesn't allow that).


    Hope this helps!
     

    Attached Files:

  9. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    Thanks Vlad! I'll tryout these workarounds!
     
  10. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    This is an OK workaroud for now if it means shipping or not in a couple weeks, but the end result is between the two methods is different. It flows better in the set position on Initialize and more twinkly on add postion on Output.

    FWIW, this is not the production graph; we're using a position map to drive the graph, but this is a simple example of a use case.


    Set Position in Initialize
    setPos.gif

    Add Postion in Output
    addPos.gif
     
  11. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    It looks like the particles are teleporting. There might be other blocks manipulating the position or velocity which are interfering, but it's hard to tell without looking at the graph. If you'd like, feel free to DM me the graph (or a min repro) and I can take a look. Otherwise I'm afraid I can't reproduce what you are seeing with the graph from the bug case.
     
  12. ludovic-theobald

    ludovic-theobald

    Unity Technologies

    Joined:
    Jun 3, 2021
    Posts:
    13
    Hello @Elliott-Mitchell, while looking into this issue, I noticed that the issue does not happen when adding a Value Bias different from 0. You can use a very small value here as a workaround, waiting for the issue to be fixed.
    I hope it is not too late!
     
    Elliott-Mitchell likes this.
  13. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    Oh, thanks! it was a little too late for that project's delivery, but will be helpful going forward into future work!
     
  14. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    2021.2.2f2 still same bug and can be solved by answers
     
  15. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    works in editor but not when I build to iPhone(AR foundation in use)