Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

VFX unwanted culling from camera

Discussion in 'Graphics Experimental Previews' started by whidzee, Jan 18, 2019.

  1. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    I am playing with using particles to make clouds that I could fly through in a flight simulator.

    I have my clouds and they are spawning across the sky. however when you get a fair distance away from the origin of the particles and are looking away from that origin then the clouds disappear. turning around and the clouds come back so i am guessing it's got something to do with the camera culling objects behind it that it cannot see, however I can still see the clouds(particles) when they get culled.

    Turning off Occlusion Culling on the camera has no effect.

    for my particle system i have one that creates particles across the sky and then i have another which creates the fluffy clouds at the position of each of these first particles.
    would it be better to just instantiate my puffy clouds as a prefab across the sky and handle them that way? or is keeping them all as particles controlled by the particle system the most efficient way?
     
    Bersaelor likes this.
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,466
    Could it be the far clipping plane distance on the camera?
     
  3. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    no it's not the far clipping plane from the camera. I just tried bumping it up 10x from it's current state and the dissappearing particles is still happening as it was before.

    I have my particles spawning inside a 600m x 600m area. and i am close to the edge of it. so i'd say that i am about 250-300m from the centre of the particle system.

    I just tried it with a simple particle system that spawns inside a Position AABox that is 600m x 600m wide and 1m tall. and the problem is visible.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,466
    Are you using 2018.3? Could you try changing the Culling Behaviour to Always Simulate?
     
  5. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    Where do i find the Culling Behaviour option? I'm using the Visual Effect Graph to create my particles
    Yeah I am using 2018.3
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,466
    Sorry my mistake, I thought you were using the Particle System. Didn't realize it was the VFX one.
     
  7. hvent90

    hvent90

    Joined:
    Jun 18, 2018
    Posts:
    19
    I wonder if this will work:
    Parenting the VFX obj to the camera so it never leaves the view, and set the particles to world space so the particles are not affected by the transform of the VFX object.
     
    BayernMaik likes this.
  8. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    That kind of works, however it follows the camera around. so if i was doing a game where the player was walking on the ground and the clouds were just up in the sky that would be fine, however my game is a flight simulator, so as you climb trying to get to the clouds they keep spawning higher and higher, further away from you :(
     
    wormhammer likes this.
  9. hvent90

    hvent90

    Joined:
    Jun 18, 2018
    Posts:
    19
    I may be misunderstanding your reply, but I believe that setting the particles to "world space" fixes your predicament. This makes the spawning of particles independent of the VFX game object's position.

    upload_2019-1-23_12-52-32.png
     
    John1515 likes this.
  10. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    Setting it to world space is not fixing my problem.

    Trying to parent it to the camera is not working.

    It seems to definitly be an issue with when you are a fair way away from the centre and you're looking away from it. so imagine a sky of clouds, say 600m across. if you are looking at the centre you get to see all the clouds, no problems at all, however if you start to turn the camera around to make the centre of the clouds not in frame then all the clouds dissappear, eventhough you should still be seeing clouds.
     
    mattxreality likes this.
  11. hvent90

    hvent90

    Joined:
    Jun 18, 2018
    Posts:
    19
    Hmm, bummer. I don't know how world-space isn't solving your issue.

    From what I understand -- particles will be culled if the VFX game object is not in view of the camera. I solved this for myself by having the game object always in view of the camera (by parenting it) and setting the coordinates to
    WORLD
    . I think this can adequately spawn clouds for a moving player.

    I'm sorry I can't help more, I guess I don't fully understand the situation.

    EDIT: OH!! Check out the grass scene in the VFX samples. The grass is spawned from the VFX graph and is always in view of the player as the player runs around. Let me know if it helps! Good luck!
     
  12. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    I have set it back to Local for the time beeing as having it in world was screwing up a couple of things.

    I was wondering if you were able to take a look and see if there was anything here which stood out to you as wacky or likely to cause this problem.

    I just tried it in the editor with the camera at the same position as the particle effect and as i move it forward, (so looking directly away from the centre) I found the particles disappear at 150m from the particle emitter. not sure if this helps shed some light on this for you.

    upload_2019-1-30_16-19-43.png
     
    P_Jong likes this.
  13. me_moldy

    me_moldy

    Joined:
    Feb 7, 2019
    Posts:
    1
    i have the same problem. i want to be able to move the camera around through a cloud of sparks. what i found out is that the VFX stays visible as long as the magic-lamp that signals the VFX is on screen
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Should be a size field somewhere where you set the bounding box of the effect, and thus where it will be culled...
     
    Neatou likes this.
  15. Nyro

    Nyro

    Joined:
    Aug 23, 2013
    Posts:
    21
    So, I was having the same problem so I changed 2 things.

    Inside the particle change the bounds and make it realy huge

    bounds.PNG

    On the Visual Effect asset change the Culling Flags

    particle.PNG

    I believe the first thing is the right one.

    Hope I helped someone. :)
     
  16. Adnaro

    Adnaro

    Joined:
    Mar 1, 2015
    Posts:
    3
    Thank you Nyro!

    The bounds did it for me.
     
    P_Jong likes this.
  17. TimBlitz

    TimBlitz

    Joined:
    Feb 28, 2017
    Posts:
    1
    upload_2019-7-16_8-19-37.png

    For me it was the 'Bounds' statement, when I changed it to Local, it did not disappear anymore.
     
    aydin_unity likes this.
  18. sevelee

    sevelee

    Joined:
    Apr 5, 2017
    Posts:
    25
    Bound did the trick. Thank you guys.
     
    P_Jong likes this.
  19. SecondCobra

    SecondCobra

    Joined:
    Jan 25, 2017
    Posts:
    31
    I had the problem where if the VFX was not on the screen the whole thing disappeared. The bounds change fixed it, thanks so much Nyro :)
     
  20. darveshi

    darveshi

    Joined:
    May 19, 2017
    Posts:
    9
    You are great dear. You helped me and hope everyone struggling with this problem. :) God Bless you.
     
    Goayakla_Defiant likes this.
  21. Demencja

    Demencja

    Joined:
    Nov 7, 2016
    Posts:
    21
    It work for me
     
  22. granit

    granit

    Joined:
    Jan 18, 2013
    Posts:
    4
    Thank you!
     
    Goayakla_Defiant likes this.
  23. savorygreatness

    savorygreatness

    Joined:
    Jan 5, 2018
    Posts:
    6
    You might also want to look into Orient : Face Camera Plane on your output, that solved it for me.
     
  24. Sentinel111

    Sentinel111

    Joined:
    Sep 26, 2018
    Posts:
    1
    To everyone with this problem, i tryed everything you said, but the problem remained. I just put everything to World, and changed the rotations of the GameObject of the vfx until i saw everything. Don't know why this is happening. But still could help someone
     
  25. toastymcvoid

    toastymcvoid

    Joined:
    Mar 15, 2020
    Posts:
    1
    Yes, bounds worked for me too!
     
  26. BayernMaik

    BayernMaik

    Joined:
    Oct 15, 2019
    Posts:
    20
    Ran into this issue aswell working on a cloud vfx. Increasing bounds didn't work for me since it seems to be limited to 3500 units(?). hvent90's approach worked for me though:
    > set the Output Node's Space to World > Parent the VFX object to the rendering camera object to ensure its always in its view > set the particles spawn position by adjusting the Initialize Particle Node's Position parameters

    My clouds now are always rendered and cast shadows on the surface below, even if i dont look at them
     
    maewionn likes this.
  27. sergiobd

    sergiobd

    Joined:
    May 14, 2014
    Posts:
    37
    None of this worked for me. Interestingly, the problem dissapears if I use Output Particle LitQuat, instead of Output Particle Quad...
     
  28. Deleted User

    Deleted User

    Guest

    wow thank you it worked
     
  29. BenStorch

    BenStorch

    Joined:
    Aug 20, 2017
    Posts:
    7
    Thank you Nyro, much appreciated !
     
  30. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    Is there a similar solution for legacy particle systems?
    I'm having a similar issue but the Occlusion Culling bake makes the particles be occluded when behind some objects. This effect has depth testing off so it's visible all the time through walls... too clever culling makes it disappear anyways.
    Can't seem to modify the system's bounds on the legacy one though, it says read-only.
     
  31. DaleTGrant

    DaleTGrant

    Joined:
    May 3, 2017
    Posts:
    1
    As far as I understand this problem, the VFX graph system is culled during rendering if the Bounds box is not visible within the Camera frustum. This even occurs if the bounds are set to recompute and always simulate. As such, the simplest ways I have to this problem is to either make the bounds gigantic and always encompass the camera position or you can set the bounds centre to that of the main camera's position.

    Both solutions work well, with the main downside being that the latter method is not good for scene view as it does not follow the scene camera. The only thing I don't know is if a bigger bounds is more expensive or not? Otherwise, why not always use a large bounds?
     
  32. power6574

    power6574

    Joined:
    Apr 29, 2020
    Posts:
    6
    I solved it.

    Problem is 'bounds' in initialize.

    You can change bounds 'size' ( 64, 64 , 64 ) or (512, 512, 512)

    . (maybe now (0 ,0 , 0 ) or ( 2 , 3 , 2) etc..)
     
  33. Yothuba

    Yothuba

    Joined:
    Oct 4, 2019
    Posts:
    21
    I think this problem can be divided into two patterns.
    One is when the boundary is not set properly, and the other is a problem with very strange behavior.
    My solution was to change the output from "Output Particle Quad" to "Output Particle HDRP Lit Quad".
    I'm not sure if this is a specification or not.
     
  34. RendergonPolygons

    RendergonPolygons

    Joined:
    Oct 9, 2019
    Posts:
    98
    bounds worked for me too, thank you @Nyro !!
     
  35. KCGames47

    KCGames47

    Joined:
    Nov 3, 2014
    Posts:
    39
    Thanks a lot Nyro for knowing the engine more than the people who created it..
     
  36. Neatou

    Neatou

    Joined:
    Jun 14, 2017
    Posts:
    2
    LOL all I had to do was switch Bounds Setting Mode to Automatic and it works perfectly.
    Thanks!
     
    hippocoder likes this.
  37. stachojakub

    stachojakub

    Joined:
    Oct 18, 2018
    Posts:
    2
    For anyone, the bounds did not work. I added Set Scale XYZ attribute and scaled it to little number.
    upload_2022-6-2_19-57-52.png

    No camera clipping after this setting!