Search Unity

Directional light glare effect

Discussion in 'General Graphics' started by AntonAndev, Sep 28, 2021.

  1. AntonAndev

    AntonAndev

    Joined:
    Aug 13, 2014
    Posts:
    44
    Hello. I have a strange problem with glare effect that is produced by directional light. This glare effect looks like a point light on the plane. If I disable directional light in the scene, this effect disappears. If I change "Y" parameter of rotation of the directional light, direction of this glare effect is changed. Also if I move camera, glare effect moves with camera in the center of game view. Unity 2020.3.17f1.
    Снимок экрана 2021-09-28 в 12.23.57.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    It's unfortunately a limitation of how specular lighting is calculated in Unity's built in shaders. It does not work properly when you use an orthographic camera, or really any camera not using the default perspective projection. The only solution is to write a custom shader that handles orthographic specular correctly, or to use diffuse only materials.
     
  3. AntonAndev

    AntonAndev

    Joined:
    Aug 13, 2014
    Posts:
    44
    Hello. I have tried to play with perspective and ortographic modes and position settings and problem has been resolved. I did not change settings of directional light and did not edit project settings. I set Y position of camera to be 15 as a child in the parent gameobject, also a clipping problem at the bottom of game view has been resolved.