Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question ACTUAL glowing eyes?

Discussion in 'General Graphics' started by Not_Sure, Jul 6, 2023.

  1. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,541
    I’ve attempting to figure this out in the past, but does anyone have any suggestions on how to make ACTUAL glowing eyes?

    Not just slapping an emission on eyes.

    Like make eyes that glow like they do in real life?

    I suppose that would mean:

    -They would only glow if facing the camera and a light source

    -The pupils would show the back of the eye and rotate the retina as they move

    -Because of the refraction it would look as though the glowing part is closer than the actual eye

    -The color of the reflected light would shift with the angle

    -It would drop dramatically the wider the angle of the light

    -The light would bleed around the pupil making it appear larger depending on the distance

    Any suggestions?
     
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    It sounds like a post effect that only comes from retinas, displaced and irridescent ...?

    If so, not sure how you accomplish that.
     
    Not_Sure likes this.
  3. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    83
    Personally I looked for such question
    This is something retroreflective shader does, but it depended on camera angle, not the light source, so this is the biggest question how to make it, yeah.
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,326
    Maybe it's because I'm fairly hard-of-seeing IRL, but I've never been able to discern all of this detail in real life. I can't imagine even noticing this level of accuracy in a game, unless you are doing a cinematic cut-scene with a close-up on the face. If that is the case, though, then maybe it would be easier to just script what you want to see rather then trying to simulate it.

    Edit: The question of determining the result based on the angle of the camera and lighr sounds similar to the fresnel effect that's usually calculated in water reflections, so maybe you could re-purpose that sort of math in your case.
     
  5. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,630
    Dot product is your friend :)

    I don't think this is necessary at all unless your retina has a texture or something recognizable in it. This is already accounted for by the glow?

    Refract the view vector using the cornea's surface normal, use results to offset iris UV coords.

    Dot product is your friend again. Remember that when used on unit vectors, it basically returns a measure of how close to parallel two vectors are: will be 1 if parallel with the same direction, -1 if parallel with opposite direction and 0 if orthogonal: https://www.falstad.com/dotproduct/

    You can use this to blend between glow colors and intensities based on view/light/normal vectors.

    For anything involving angles between vectors: dot product!

    Emissive + bloom?
     
    Last edited: Jul 10, 2023