Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Applying Multiple Shader Effects to a GameObject

Discussion in 'Shaders' started by Opeth001, Jan 23, 2021.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    do you have an idea about:
    How do games like SpellBreak apply these kinds of effects to other objects like the ground in this case?
    is there a way to do this in Unity Engine?

     
  2. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    395
    If it is not built into the terrain / grass shader then it looks like it could be some sort of decal projection perhaps?
     
    Opeth001 likes this.
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    I don't think this is built into their terrain shader as this effect can be applied to anything.

    I'm new to shaders, but from what I just saw about the decal projection, it's quite possible.

    Thanks @jamespaterson !!
     
  4. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    here, as you can see, it's not just a simple decal projection since the grass and the player are affected by the effect.
     
  5. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    395
    Looks like a cool game. From the screenshots above i would say probably a combination of different techniques are in use. Definitely some particle effects in there and maybe decal projection. Have you downloaded the unity standard particles pack from the asset store? That has a "earth shatter" effect very similar to one of the gifs above. There are also some pretty decent "magic effects" packs on the asset store for a small charge. You might not want to use them verbatim but you will learn a lot by looking at how they are constructed. Good luck with your project!
     
    Opeth001 likes this.
  6. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    yes I tried to see how this effect was made to get a starting point, the case was a little similar but very far from what I am looking for because it does not take into account the environment. the Unity effect just spawns particles with some shader effect and setting the y vector to 0.
     
  7. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    395
    So in particular for this effect the issue is you wish to use it on uneven ground e.g. a terrain or mesh, rather than a flat plane as per the unity demo? It might be possible to achieve this using colliders on the particles to control the height, or failing this a more sophisticated approach where particles are manually emitted via a script which raycasts down at regular intervals along a line perhaps?
     
    Opeth001 likes this.
  8. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    emitting particles via script to fit a mesh can be a good idea, but in some cases it will not be smooth, I think the best option would be to use a particle system for any fire/dust effect and mesh decal for floor cracks.
     
  9. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    395
    Sounds like a good approach. Good luck with your project!
     
    Opeth001 likes this.