Search Unity

Realistic Laser Sight Rendering

Discussion in 'General Graphics' started by twda, Jun 25, 2017.

  1. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    Hello!

    I'm trying to render a laser pointer realistically.

    Unfortunately I don't have one at hand, so I can't compare the results.

    What I came up with was a LineRenderer with Particles/Additive material:

    _lr = nParentForLaser.gameObject.AddComponent<LineRenderer>();
    _lr.useWorldSpace = false;
    _lr.material = new Material(Shader.Find("Particles/Additive"));
    _lr.widthMultiplier = 0.02f;

    It looks like this:


    In this screenshot, the LineRenderer points slightly over the FPS controller's head.

    I was trying to achieve a realistic look, but to me, it looks like the laser points up to the sky.

    Does anybody have any idea how to make it better? I would like to make it plain to see that the LaserPointer is aiming forward, not into the sky.

    Thank you for any help!
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    don't put the gameobject of the pointer above the camera's position, do it below.
     
  3. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    @neoshaman Basically, you're right, but I want to keep it as real as possible, so I don't want to change anything regarding the position. The laser sight comes from the left eye and renders straight forward to indicate where the eye's looking.

    I need to change something else.
     
  4. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    350
    In video game development, there is a line between realism and intuition. If the realism works against intuition, it's a betrayal to your audiences. An aiming laser from 1st perspective not coming out from the vertical middle line of the screen is counterintuitive to the player's mentality.
     
  5. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    It just can't be there if it come from the eyes, also you have only one camera.
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    People aren't used to having a laser beam coming from their eyes, or from just above the eye, so it'll look wrong. A laser pointer is more likely to be seen held below (like from one's hand).

    Other problems are real laser pointers are going to be much narrower beams of light than the one you have, though making it narrower won't help with the appearance of it coming from "above" what will really help is you'll never really see the full line of a laser unless you're in a very heavily fogged area, usually it'll just be small specs of light as the laser illuminates dust, and then a bright "dot" where it actually hits. You can fake that a bit by having the laser use a cloudy noise texture for the alpha and fade it out as it gets closer.

    Note that any image you find online of laser light is either going to be faked, using a long exposure, or in heavy fog (especially if it's from a movie). This is because in the "real" world laser light looks pretty boring and usually isn't that uniform line of light hovering in mid air everyone wants it to be.
     
  7. BakeMyCake

    BakeMyCake

    Joined:
    May 8, 2017
    Posts:
    175
    To add to what bgolus said, if you want the the lazer coming from the players left eye, it would make sense to put its' origin slightly to the left of the cameras' position.