Search Unity

What default shader should I use for my laser blaster beam (don't want it to be additive)?

Discussion in 'Shaders' started by johot, Jan 4, 2017.

  1. johot

    johot

    Joined:
    Apr 11, 2011
    Posts:
    201
    If I want to display a particle, or in this case a blaster beam (think star wars style) and I want it to have a solid color rather than a semi transparent color what shader should you guys use?

    Similair to how this looks:
    https://i.ytimg.com/vi/SKBN7nQQlLU/maxresdefault.jpg

    What I found was that if I use the Particles/Additive one it goes semi transparent. I would like to have a shader where I can make a solid (but with transparent/soft edges) beam, it would also be nice if I could tint it, so I would basically draw a white glow in photoshop and use that.

    What shader would you guys use?

    Thanks!
     
  2. tsangwailam

    tsangwailam

    Joined:
    Jul 30, 2013
    Posts:
    280
    How about using a simple "laser beam" texture with a unlit shader?
     
  3. johot

    johot

    Joined:
    Apr 11, 2011
    Posts:
    201
    But can an unlit shader be used for tinting? Or would I need to make say a red or green png (the color of the beam?). Thanks!
     
  4. tsangwailam

    tsangwailam

    Joined:
    Jul 30, 2013
    Posts:
    280
    Default Unlit didn't have tinting. But it is easy to add.
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Unity ships with several particle shaders. Try a few? Most likely you'll want a Particle Alpha Blend shader of the shaders Unity ships with. However a true premultiplied alpha shader would allow you to get a look much closer to what you see in that screenshot (which is actually the product of HDR rendering and bloom). Unity does ship with something it calls a premultiplied alpha, the default particle material uses it, but someone modified it several versions ago and now it is actually just a slightly broken alpha blend shader.
     
  6. johot

    johot

    Joined:
    Apr 11, 2011
    Posts:
    201
    @bgolus @tsangwailam Thank you for your answers! I will look through the particle shaders again. Actually the closest I have gotten to the effect in the image so far has been to use the Unlit Transparent shader or the Sprite shader (are the performance mostly the same for those?). I can easily tint the texture using the Sprite shader, but not the Unlit transparent shader.

    Would it be "ok" to use the Sprite shader in this case? About alpha blending, is that when I have a separate texture that defines the transparency? Or do I simply use a transparent png?

    Thank you again!