Search Unity

VFX unwanted culling from camera

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

  1. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    108
    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?
     
  2. karl_jones

    karl_jones

    Unity Technologies

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

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    108
    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:
    3,686
    Are you using 2018.3? Could you try changing the Culling Behaviour to Always Simulate?
     
  5. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    108
    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:
    3,686
    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.
     
  8. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    108
    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 :(
     
  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
     
  10. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    108
    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:
    108
    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 Moderator

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

    Nyro

    Joined:
    Aug 23, 2013
    Posts:
    17
    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. :)
     
    darveshi, P_Jong, swanickj and 2 others like this.
  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.
     
  18. sevelee

    sevelee

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

    SecondCobra

    Joined:
    Jan 25, 2017
    Posts:
    12
    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:
    4
    You are great dear. You helped me and hope everyone struggling with this problem. :) God Bless you.
     
unityunity