Home Technical Talk

Unity - Particle Clipping Terrain

polycounter lvl 9
Offline / Send Message
Bumper polycounter lvl 9
Scratching my head on this one.

I have a particle (billboard) that is clipping/penetrating into the terrain.

cllipping_particle.JPG

I've tried the 'queue = overly' solution in editing the shader to no avail. The particle continues to render before the terrain.

Any possible solutions would be greatly appreciated!

Replies

  • AlecMoody
    Offline / Send Message
    AlecMoody ngon master
    Two options I can think of. You could modify a copy of the material to change the z order. Or, create a second camera parented to the primary camera and use another render layer with the z order adjusted.
  • Bumper
    Offline / Send Message
    Bumper polycounter lvl 9
    AlecMoody wrote: »
    Two options I can think of. You could modify a copy of the material to change the z order. Or, create a second camera parented to the primary camera and use another render layer with the z order adjusted.

    Thank you for your reply!! I assure you this is for a good cause (art test!)

    I gather I would modify the material (or more accurately the shader?) within monodevelopment/text editor? What variable would I change to change the Z order? Again, I tried changing the queue = overlay and it did absolutely nothing.

    I'm relatively new to Unity and VERY new to any scripting witchcraft.

    Thank you again!
  • AlecMoody
    Offline / Send Message
    AlecMoody ngon master
    If you don't know HLSL then using two cameras and messing with the clear flag is a lot easier. Create a render layer for your object (or assign it to an existing layer). Set the main camera culling mask to everything except your explosion layer. Set the child camera culling mask to only be your explosion layer. The child camera should have the clear flag set to "don't clear" and put a positive value into the camera depth.
  • Bumper
    Offline / Send Message
    Bumper polycounter lvl 9
    AlecMoody wrote: »
    If you don't know HLSL then using two cameras and messing with the clear flag is a lot easier. Create a render layer for your object (or assign it to an existing layer). Set the main camera culling mask to everything except your explosion layer. Set the child camera culling mask to only be your explosion layer. The child camera should have the clear flag set to "don't clear" and put a positive value into the camera depth.

    Makes complete sense!

    However, I duplicated the main camera and parented (is that how you make a child camera?) it under the main, and followed the rest of your instructions, but no dice.

    No doubt a case of pilot error somewhere on my part.
  • Bumper
    Offline / Send Message
    Bumper polycounter lvl 9
    AlecMoody wrote: »
    If you don't know HLSL then using two cameras and messing with the clear flag is a lot easier. Create a render layer for your object (or assign it to an existing layer). Set the main camera culling mask to everything except your explosion layer. Set the child camera culling mask to only be your explosion layer. The child camera should have the clear flag set to "don't clear" and put a positive value into the camera depth.[/QUOTE


    AH-HA!! setting the Clipping Planes on the child camera to 2, plopped the explosion right on top of the terrain. I could kiss you! Or maybe a virtual fist-bump would be more appropriate.

    Thank you!!
Sign In or Register to comment.