Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

ParticleSystem won't display on SkinnedMeshRenderer

Discussion in 'General Graphics' started by FeastSC2, May 7, 2020.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    893
    I have a burning effect particle system that has its shape set to use a SkinnedMeshRenderer.

    The particles renders correctly for most of my characters; but for 2 of them the particles just won't render.
    The particles are being spawned but they won't render:
    upload_2020-5-7_5-20-27.png

    Here is when they render (on the other character):
    upload_2020-5-7_5-21-16.png

    - I have looked at the problematic mesh and it has read/write enabled. I really don't see any differences between the meshes and it's unclear to me why the particles won't show.
    In fact, I copied the FBX import settings from the left character to the mage (on the right) and nothing changed.

    - I was thinking that maybe the particles are inheriting from the mesh's colors but it's toggled off so it's not that.

    Any idea why my particles are not rendering on that mesh?

    upload_2020-5-7_5-32-36.png upload_2020-5-7_5-32-47.png upload_2020-5-7_5-34-59.png
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,247
    Can you share a cut down project with the problem so I can take a look?
     
    FeastSC2 and richardkettlewell like this.
  3. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    893
    I sent you a package via personal message
     
    richardkettlewell likes this.
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,247
    Hi,
    The problem here is the scale. The particle system uses the scale of the skinned mesh renderer root bone in order to know where the particles should be. The meshes that work here are scale 1 but the ones that do not are 0.01 which causes your particles to become very small.
    Unfortunately, there's no simple way to work around this other than to scale up your system properties(particle size etc) for the ones that do not work. You cant scale the transform on the system, you have to scale the actual properties im afraid.
    When driven by an SMR we do not use the particles transform values (Pos, Rot, Scale) and instead use the SMR values.
    If possible fix the scale on the source mesh(bones) so that it is 1.
     
    Last edited: May 7, 2020
    FeastSC2 and richardkettlewell like this.
  5. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    893
    I see, thanks :)
    The scale appears to be based on the scale of the "Root bone" defined in the SkinnedMeshRenderer. This would be useful information to have in the documentation.

    This requires modifying the package in a 3d software. Definitely not easy when using the Asset store :-/

    It leaves the last option: to scale the particles's start size etc...

    Damn, I wish there was a way to fix these joints/model from the FBX importer somehow. :)
    But here it's a real mess because the joints and meshes are randomly scaled.
    https://i.imgur.com/zAEKjIc.png
    https://i.imgur.com/lyWvuYY.png
     
    Last edited: May 7, 2020
  6. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    893
    @karl_jones
    The problem with using the skinnedMeshRenderer's scale is that it's probably never what the devs want: scaling up/down particles hardly ever looks good.

    If the particles kept their own local transform scale it would be better in my opinion.

    I ended up adjusting the particle size based on the skinnedMeshRenderer lossyScale.
    But... if the character's scale changes during the game, my particles are going to be messed up again xD. So it's not a great fix.

    Thanks again for figuring it out ;)
     
  7. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,640
    The theory is supposed to be that if the skinned mesh and the particle system were both visible on top of each other, that the 2 would automatically line up with each other.
     
    FeastSC2 likes this.
  8. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    893
    I don't know to which situation this applies, it might be useful in some case to have larger/smaller particles.
    In my usecase, enemies can be burnt, wet, poisoned, ... and if the particles are larger because the unit has been scaled up, you see big ugly particles.

    But if you were to not scale the particles (like I proposed above), you potentially might need to adjust the amount of particles based on how big the unit you're emitting from. That is if you still want to clearly see the particles, you might need more, altough that's not strictly necessary.

    The problem with your way, it means every meshRenderer you want to have particles on must have the perfect size by default. That's a really big ask.

    That's why an additional option to not take into account the scale would be useful. However, as always, I understand if you don't want to change anything.
     
  9. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,640
    Well it was simply so that the effect appeared proportional to the source mesh.

    I can think of use cases where this is appropriate. But I can also see your point too, for your use cases.

    If I’m remembering the code correctly, excluding only the particle sizing from the overall scale maths is going to be tricky.

    If there any possibility that you could add a script that removed the scaling from the particle start sizes?
     
    karl_jones and FeastSC2 like this.
  10. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    893
    Yes that's possible. But that assumes the mesh you're emitting from won't change its scale anymore ;)

    Although there might be a way to discover when that happens. So it's not a big deal.
     
    richardkettlewell likes this.
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,247
    So the problem is that the position and size of the particle are both coupled to the scale. If we ignore the scale or use a different one then the particles would no longer appear on the mesh in the correct positions.
    We have talked about it internally and are going to look into decoupling the position and size scaling.
    If things go well this should be available in a future version, ill post again when I have more info.
    Thanks for the feedback
     
    FeastSC2 likes this.
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,247
    Hey.
    We just landed a change in 2020.2.0a14 that allows you to use Local and Shape scaling mode when using a SkinnedMeshRenderer or MeshRenderer with the Shape module.
    I tested it with your project @FeastSC2 and it now works as you originally expected.
     
    FeastSC2 and richardkettlewell like this.
  13. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,640
    Unlimited triggers and colliders landed in that version too - you’re doing pretty well for feature requests at the moment @FeastSC2 ;)
     
    FeastSC2 and karl_jones like this.
  14. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    893
    richardkettlewell and karl_jones like this.
unityunity