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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Particle problem - Differences between Beta 16 and 14

Discussion in 'Unity 5 Pre-order Beta' started by Todd-Wasson, Dec 18, 2014.

  1. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,077
    I'm manually adjusting particle sizes and so forth inside of LateUpdate(). There appears to be a difference between beta 14 and beta 16 though. These pictures are from beta 16 which shows behavior I don't want. My particles essentially start with size 0 (or very close to it). However, in beta 16 I always see some particles with some arbitrary size displayed.

    In the first picture you can see a stream of particles where there shouldn't be any. If the max particle size is set to 0, these particles exist for a very short time (perhaps 1 graphics frame, don't know) before their size is adjusted. This is the same thing that I'm getting in beta 16 when adjusting the sizes myself. In beta 14, however, when I resize all the particles in LateUpdate() it looks just like it's supposed to. The particles in the red box are not visible or are at least a lot smaller.

    In the second picture you can see what happens, the particles in the red box get resized to fill the yellow area which is how they're supposed to look.

    It seems to me that in beta 16 the particles are being created and rendered before I get a chance to update their state. In beta 14 it didn't work this way. As long as I did the update in LateUpdate(), it looked just like it was supposed to where the particles in the red box were not visible or at least blended into the shape of the particles in the yellow box. So something there changed between 14 and 16. Is this by design or might a mistake have been made somewhere between beta 14 and 16?

    If this is how it's going to work in the future, what can I do to get control of all of the particles including the ones that were just created in the last frame?




    Particles1.jpg Particles2.jpg
     
  2. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,077
    Bump. This is still a problem in beta 18. Does anyone know if it's been changed in beta 20 to work how it did in the past?
     
  3. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    First, update to newest beta, then talk bout problems. And btw why are you changing particles size via script?
     
  4. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    I am running into this issue as well. Will work on setting up a repro project.
     
  5. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,077
    @Roni92:
    At the time I wrote this it was the latest beta (18). ;) The last beta I tried that didn't have this problem was beta 14. My hopes are not high that it's been fixed in 20.

    I'm doing this all via script in order to get the behavior I want with the rooster tails behind the boat. For one thing, the size needs to be controlled precisely in order to have the bottom of each billboard stay in contact with the water plane. I also create them slightly below the waterline, then destroy them when their y velocity becomes negative and they fall back to the waterline. That kind of thing. So I need more control over it all than the default Unity stuff allows.

    What appears to be happening is that it renders a set of freshly created particles before it lets their sizes be set. The last time I tried it, it was doing it also if you set the max size in the inspector to 0 or something very small even without manipulating them in a script (see first picture in original post, those particles should not be visible). I.e., you get a few big particles every frame that then pop to size 0 later (probably one frame later but am not sure).

    In 14 it works like it should, but I had to do it in LateUpdate(). That's fine, as long as there is some way to manipulate the freshly created ones before they're rendered, I don't really care what function it needs to be done in.
     
  6. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    I think possible workaround would be to make your particle prefab disabled, so when you instantiate it, it will be disabled(invisible), change it's size, and in the end just enable it, that way it should be impossible for it to instantiate and render with wrong size.
     
  7. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    If it is a regression, chances are usually high that is gets resolved.
    But, someone needs to report it! And if yo do that, don't forget to mention the case number here if a Unity engineer comes by.
     
  8. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,077
    @Roni92 Thanks for the idea, but think I'll pass on that one. I really think it's just an ordering issue where the rendering is done before getting access to the new particles.