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. Dismiss Notice

My particles are drawing their shadows on top of thelseves

Discussion in 'General Graphics' started by tcz8, Mar 20, 2020.

  1. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Not sure why this is happening, here is a shot:

    upload_2020-3-20_15-24-34.png

    It's as if their shadows were projected on top.

    I'm currently using the Standard Surface shader in the particle category.
     
    Last edited: Mar 20, 2020
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,240
    Try increasing the shadow bias in the renderer module.
     
  3. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    YOU THA MAN! Thank you so much!

    If you happen to drive by again, you wouldn't know a trick to make them lay flat on the ground once they collided? Trick is they have to keep their current settings so strong wind zones can pick them up again (current setting lets them rotate in the wind).

    I wish we could use another collider shape.
     
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,240
    Heh, sorry no we don’t have anything for that. you’d have to write your own scripts for it. Even the collision callback doesn’t support letting you modify the particle properties :(
     
  5. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Ohhh noooooooo :(
     
  6. MTUA

    MTUA

    Joined:
    Oct 26, 2018
    Posts:
    29
    You could try looping children with the appropriate settings for each successive state
     
    tcz8 likes this.
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    The reason why the original setup has self shadowing is billboard particles turn to face the current rendering view. For the main camera this is obvious, but it also faces the light when rendering shadow maps. Another way to avoid this problem, apart from the shadow bias feature, is to use Render Mode Mesh, use the default Quad mesh, and use a 3D start rotation with a random range. This will have a very different look than the camera facing billboards, more like real leaves, but the benefit is now the particle orientation isn’t dependent on the view.

    Another odd option is to play with the Pivot Z so the particle is pushed towards the camera far enough to no longer “intersect” with the shadow. But this has other artifacts that may be undesirable. For my own shaders I do this push in the shader itself such that the particle doesn’t change its visual appearance (you’ll understand what I’m avoiding once you try playing with the pivot z), but that’s a lot more involved.

    As for having the leaves lay flat on the ground, the trick I’ve used is to make the collision on the particles very small, and have them die and spawn a new particle when they collide. It only works on perfectly flat ground unless you use a c# script to spawn the particles with a proper alignment.
     
    tcz8 and richardkettlewell like this.
  8. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Wow, haven't been around for a while, been busy fine-tuning our parkour animations & transitions.

    @MTAU You mean using sub emitters to emit new particles that lay flat and set the parent particle to expire on collision?

    @bgolus As usual you're a living wikipedia of game design knowledge! Thanks for all that info, I will get back into that as soon as I'm done knit picking our state machine.


    Unity has so many knobs, without people like you id go nuts o_O

    Thanks for the help!
     
    richardkettlewell likes this.