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

EYE ADVANCED - Realistic Eye Shader

Discussion in 'Assets and Asset Store' started by chingwa, Feb 21, 2015.

  1. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    can I import the eye model into blender without problems ?
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    Exchange the object in Unity... Simply delete the existing eye objects and put EyeAdvanced Eye Prefabs in their place, parenting them to the eye bones of your character model.

    IF the eyes in your character are not separate objects then you'll need to first delete the eyes in a 3d modelling app, before bringing the character into Unity.
     
  3. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    No, You should use EyeAdvanced Materials and Prefabs in Unity, not in a 3D modelling app.
     
  4. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
  5. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    the character will be animated..
     
  6. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    rigged & animated ^^
     
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    From your screenshot it looks like the eyes are separate objects. Simply scale EyeAdvanced prefabs to the same position/size and delete the original eye objects. If you rig the character, then parent the EyeAdvanced prefabs to the eye bones for eye animations to work. Should be all you need to do.
     
  8. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    it will be rigged in blender . . . how does that work ?!
     
  9. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    In Unity you go to the eye bone object in your character hierarchy and drag the EyeAdvanced prefab onto the bone object, which makes it a sub-object of that object (this is known as "parenting" the eye to the bone object). The EyeAdvanced prefab will then automatically follow the bone rotations.
     
  10. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    okay i am beginning to understand it ^^ i hope

    so if the original eyes are rigged & animated, I can still exchange them in Unity, and the animation would still work...

    I hope I got that right :0
     
  11. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    Pretty much. Unity objects will not automatically inherit animation/skinning data from a skinned mesh, BUT they WILL follow animated bones that they are parented too.
     
  12. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    @Works-Dev you can use the shader and it's material on any eye model that has the same UV setup. But as chingwa mentioned, it is easier to use the included mesh and replace your model's eyes with that compared to reworking the UVs of it's original eyes. All of that can be done in Blender of course and it is not too difficult. Just make sure the eyes end up in the same place and are rigged to the same bone as the original eyes were. It isn't possible to just put the material on some random eye mesh, because how should the shader know, where the center of the eyes are, etc. that's not how modeling works..
     
    chingwa likes this.
  13. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    I bought it yesterday & it looks really good :D

    only I don't know if I can exchange it properly... i will experiment a little...
     
  14. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    Yeah, good luck with that! Remember that experience with Blender is experience for life, since you will never be able to not afford that tool. ;-)
     
  15. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    why doesn't it work that the eye delitions moves ?

    https://ibb.co/GnKbygx

    I do not know what I'm doing wrong.
     
  16. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @w0rks-Dev Make sure the correct directional light is in the dilation slot. Also dilation does not work while not playing, try playing your scene and checking the dilation function.
     
  17. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    Oh, I thought it would also work in edit mode xD
     
  18. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    229
    Thanks for this great asset!

    I've switched my project to URP and now the sclera is getting dark areas when further away from the camera. This happens with and without LODs.

    Here's the demo scene in builtin SRP with the camera further away, looking good:
    image

    And here's the demo scene in URP, with dark areas on the sclera:
    image

    How can this be fixed?
     
  19. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @Faikus I'm glad to hear your enjoying EyeAdvanced! These dark areas in URP seem to be related to texture import settings. What I recommend is to disable the "generate Mip Maps" setting on the Texture importer for both the eyeball_iris texture and the eyeball_mask texture. If you are still seeing this then you should reduce the "limbal ring amount" setting in your eyeadvanced material until you no longer see this artifact.

    It's possible there is something in the shader that is not clamping texture values properly in URP. I will take a look into this. In the meantime I think the above should help a lot.
     
    hopeful likes this.
  20. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    229
    Thanks, disabling mipmaps worked!
     
  21. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,009
    Hi I have downloaded your demo project and got few questions.

    First of when I set pupil dilation to 0% I got iris darkening on the border (only in a girl scene), this might be the same problem as above but it is an official demo so I had to ask.

    I want to have white sclera but in this demo it is red when I set sclera color to white, is this changeable ?

    Is it possible to have even bigger iris than what demo allows ?

    I need vertical pupil changeable to big oval (cat like eyes) but I don't see any settings of that kind in demo.
     
  22. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @koirat Thanks for your interest in EyeAdvanced!

    I think the eye darkening you're seeing in the demo is due to the limbal darkening setting (which not adjustable in the demo scene but certainly is on the material). I only see it when using large pupil sizes, so this could then be adjusted accordingly as needed.

    You aren't able to get a completely white Sclera in the demo due to the underlying base texture having a reddish wrap around the sides and back (assumed it will be incorporated into a character so would not see most of it). You could replace the sclera texture with a white texture in order to get full white.

    The iris max size is determined by clamping in the shader, so by default you would not be able to get bigger than what is shown in the demo.

    It is possible to do cat-like pupil shapes, though it is not shown in the demo. you would simply need to replace the iris and iris mask textures on the eye material. There is an example cat iris/mask texture included.
     
  23. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    266
    I just started working with your asset and I'm very pleased with the results. I did have one issue where the eyes started looking black as they got further away from the camera. I discovered it was the Limbal Ring Amount causing the problem and setting it to 0 fixed it. Is this a bug by chance? I don't see any difference up close with any value so it seems like an unnecessary item. In the image, you can see two identical sets with the top set to 0 and the bottom set to 1.
     
  24. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @reggie_sgs Yes this seems to be a bug when using EyeAdvanced in URP (as detailed in the posts above, also see the above for a partial solution regarding clamp settings) Hopefully I'll have a URP shader update to fix this soon.
     
    reggie_sgs likes this.
  25. sctiendat

    sctiendat

    Joined:
    Mar 14, 2020
    Posts:
    22
    @chingwa , Hello, Can I easy to make a animation for iris in your eyes shader by change UV of iris texture?
    I need to animation like rotate the eye iris. Can i do that with your asset?
     
  26. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    I don’t recommend animating the UVs, as it might inadvertently change the expected mapping and cause graphics glitches. I instead recommend rotation the eye object, or better, parenting EyeAdvanced prefab to your eye bone, and rotating/animating the bone.
     
  27. MrBrightside

    MrBrightside

    Joined:
    Nov 17, 2016
    Posts:
    3
    Hi, is it possible to change the color of the pupil? (I have a specific use-case)
    Otherwise the shader looks incredibly realistic! Well done.
    Greetings, Fabian
     
    Last edited: Feb 23, 2021
  28. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @MrBrightside There isn't an option in the material to change the pupil color. I will investigate adding this as a feature. However if you don't need the pupil color to be editable you can just change the pupil in the main texture to be a different color (the texture in the "iris texture" slot).
     
  29. MrBrightside

    MrBrightside

    Joined:
    Nov 17, 2016
    Posts:
    3
    Thank you for the quick answer, I think changing the texture is sufficient for now, but adding it to the material would make it easier for me.
     
  30. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784


    Hello All,

    I'm happy to announce that Eye Advanced version 1.1.1 is now ready for download...
    Download Here: http://www.tanukidigital.com/download

    This update adds adds the limbal ring shader feature into HDRP and URP render pipelines, which was missing it before. It also improves limbal rendering by giving a new option to use a color tint to the limbal ring, and improved some of the rendering for more realistic look. Those who were already using this feature may need to adjust their settings slightly after upgrading. Finally the minimum compatible version has been raised to Unity 5.6.7, though I don't expect many are still using such an old Unity version at this point. :D

    To enable SRP support make sure to import EyeAdvanced into your existing HDRP or URP project, then double-click on the relevant .unitypackage file from the newly added "_SRP" folder. This will import and update all shaders / textures / materials as necessary for that pipeline.

    Version 1.1.1 will be available on the Asset Store later this week.

    As always, let me know if you have problems/questions/feedback etc, either by email or on the forums!

    All the best,
    Justin Kellis
    Tanuki Digital


    ------------------------------------------
    RELEASE NOTES - Version 1.1.1
    ------------------------------------------
    - Raised minimum uploaded version to Unity 5.6.7f1.
    - Adjusted Limbal Ring rendering for more realistic visuals.
    - Added "Limbal Color" property to adjust color/alpha of the limbal ring.
    - Added missing Limbal rendering into URP shaders
    - Added missing Limbal rendering into HDRP shaders.
     
  31. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,192
    Sweet! I would love to see some screenshots, maybe a before and after of the update!
     
  32. flarn1

    flarn1

    Joined:
    Nov 5, 2018
    Posts:
    3
    Hello, and thanks for the beautiful eyes! About VR compability, I made a build for Quest 2 and the eyes of my character were not visible. Is this shader not Quest compatible?
     
  33. ThisGuyThatsHere

    ThisGuyThatsHere

    Joined:
    May 4, 2016
    Posts:
    11
    Hello, is HDRP 12 (Unity 2021.3) supported?
     
  34. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
  35. schala

    schala

    Joined:
    Jul 24, 2012
    Posts:
    21
    Hi! Is this asset compatible with the latest versions of Unity (2022.x and URP 14)?