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. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    388
    Does Eye advanced work in Unity 2019?

    Thanks!
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    Yes it should work in 2019.x without any problems, as long as you're using the standard Unity renderer.
     
  3. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    388
    Thank you for the fast reply.

    Great! I will buy it then.
     
    chingwa likes this.
  4. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    388
    Hi,

    I am having a little problem with the auto "pupil dilation" feature. I wonder if you can help me. :)
    In the demo scene the "auto pupil dilation" works fine but when trying to use the feature on my own character, it doesn't work. You can see the attached picture to see my setup.

    Any help would be appreciated!

    Thanks!

    eyesAdvanced.JPG
     
  5. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @netpost Hmm, I'm not really sure why it wouldn't be working. It operates based on the Intensity setting of the directional light, and generally expects it to be 1.0 or higher. If you have a lower intensity you may see mixed results. Also it only runs in play mode. Perhaps try disconnecting the scene eye object from the prefab (i.e. gameobject/break prefab instance) and see if it helps?
     
  6. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    388
    Thanks for the quick reply. :)

    I deactivated my character leaving the eyes all by themselves and it worked. I then reactivate my character game object and it still work, but it is more subtle because the lighting is not as strong as when there is no head wrapping the eyes socket. So I understand now that the intensity of the light make the dilation happen and not necessarily the direction of the light.

    So everything is good. Thank you for the great support!
     
  7. starsmiling

    starsmiling

    Joined:
    Jul 23, 2019
    Posts:
    1
    It seems like the web player version doesn't work. Any suggestions? Thanks!
     
  8. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @starsmiling Thanks for letting me know. I'll have to take a look at the website code to see what the trouble is. In the meantime you can download a direct demo appliction (for PC) here:
    [link removed]

    Edit: I got the page working again but the webplayer isn't working. You can download the PC demo direct from the page now: http://www.tanukidigital.com/eyeadvanced/demo/
     
    Last edited: Jul 23, 2019
  9. FS9606

    FS9606

    Joined:
    Mar 12, 2015
    Posts:
    21
    Can you provide any hints on doing this. Or support if I get stuck?
     
  10. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @FS9606 If you can replace the eyes on your character with a normal Unity sphere, then you can setup Eye Advanced eye prefabs in the exact same manner. Generally this involves positioning the eye prefab in Unity and parenting it to your character "eye" bone object. Easy as pie.
     
  11. dmattock

    dmattock

    Joined:
    Oct 13, 2016
    Posts:
    1
    Hi this looks great, can I ask a few pre-sales questions

    1) Does it work with HDRP?

    2) My animated characters are alembic files from Maya, can I just simply apply your eye material to my characters eye geometry?

    Many thanks
     
  12. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @dmattock EyeAdvanced will not currently work with HDRP. There is still so much in flux with Unity's pipeline that it hasn't been worth investing the time (not to mention frustrations whn they change from version to version). Once they have an official release that is not marked "preview" I will investigate putting out an HDRP-compatible version.

    As for using the material by itself, in some cases this may be possible (depending on the existing geometry / uv coordinates), but in most cases you'll need to replace the existing eye geometry with EyeAdvanced prefab objects... parenting them to any existing eye "bone" transforms to control movement.
     
    Last edited: Aug 13, 2019
    OfficialHermie and Xac like this.
  13. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,058
    Hi checking back again on whether you have tested in mobile... The results look different than in editor for iOS on iPhone XS Max

    Editor: https://gyazo.com/d18bd9667ba69bfb3cdf2742b7023281

    iPhone XS Max: https://gyazo.com/0c802b3313c74d1ebf76d98d0d195b95
     
  14. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @ina interesting. Are you sure it's not just a difference in lighting overall? The skin also looks different as if the scene light is either warmer or with a higher intensity, or possibly it's a difference in postprocessing between editor/device?
     
  15. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,058
    turned out to be a LOD issue! different diffuse texture for each LOD...
     
  16. timbokoppers

    timbokoppers

    Joined:
    Nov 14, 2016
    Posts:
    69
    Any change of a LWRP/ URP version soonish? Would be really appreciated
     
  17. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @timbokoppers I'll be investigating LWRP /URP and possibly HDRP versions in the next couple months I think. Exact timing is still TBD.
     
    timbokoppers likes this.
  18. Jribs

    Jribs

    Joined:
    Jun 10, 2014
    Posts:
    154
    @chingwa LWRP should be high on your priorities. Anyone doing modern VR dev can't use this product until then
     
    timbokoppers likes this.
  19. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    Hi, I'm trying to implement daz characters into unity, they use combined meshes for both eyes and the textures look like this:
    upload_2020-1-2_22-2-12.png
    upload_2020-1-2_22-2-37.png

    Is it possible to use your shader to render these eye models?
     
  20. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @Harekelas Hmmm... you would either need to have separate eye objects and replace them with EyeAdvanced prefabs (which is the recommended method), or rework the eye UVs so that they follow the EyeAdvanced uv set. Below is an image of the UV layout:

     
  21. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    Can I simply change the texture to fit the UV of the models?
     
  22. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    You could probably do that. I have not tried it myself but I can't think of why it wouldn't work. The main problem with doing it this way is that there are multiple textures in Eye Advanced that combine to build the eye visuals. Eye Sclera, Iris, normal, and mask textures would all need to be edited.
     
  23. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    Yeah, I plan to edit all of them.
     
    chingwa likes this.
  24. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    Tried to edit the textures, but it doesn't seem to work, I've readjusted the UV of the eyes, see if this can work.
     
  25. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    I remodeled the eyes into a sphere like this:
    upload_2020-1-4_0-21-51.png

    And the uv is unwrapped like you suggested:
    upload_2020-1-4_0-22-37.png

    But now I got this kind of artifact in the middle of the eye:
    upload_2020-1-4_0-23-7.png

    The material looks correct, I think it still got something to do with the uv or the mesh. What do you think the cause might be?
     
  26. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    I'm not really sure what would be causing the center spot. Possibly has to do with calculations in the shader for parallax or the pupil dilation or iris size as all 3 of these do calculations based on the center of the uv layout. Or it's possible it's something in the mesh. If you'd like to send a copy of your new mesh over I'd be happy to check it out on my end. Feel free to email a download link to konnichiwa[at]tanukidigital.com if you don't want to post publicly.
     
  27. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    I've sent you a dropbox link to my modified eye mesh.
     
  28. SenseDevil

    SenseDevil

    Joined:
    May 25, 2019
    Posts:
    5
    This is the most beautiful eye effect on the asset store! When will it support URP? We very much hope it supports URP. Update please~~~~~
     
  29. Escope12

    Escope12

    Joined:
    Dec 27, 2017
    Posts:
    14
    I have a question about this shader? Is it possible to bake the shader into a separate iris texture with Unity?
     
  30. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    I'm not sure what you mean by baking the shader. Can you elaborate?
     
  31. Escope12

    Escope12

    Joined:
    Dec 27, 2017
    Posts:
    14
    What I mean is How can I fix the eye iris texture and make it into a new texture with the shader?
     
  32. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    Do you want to use this eye shader in your final product, or if you want to bake the eye effect into a texture then use another shader in the final product with the baked texture?
    If latter, there is no way to "bake" the eye effects, you'll need this shader for them to look like this.
    If you want a texture of the full eye (not as procedural as in this shader) with this shader's look you may need to create a new shader to generate this texture.

    If you want to create and use your own eye iris textures for the eye, you can simply create your own texture through eyes' photos in photoshop then replace the iris texture with your own's.

    And if your character model's eyes does not fit this shader's uv, you should change the eye mesh in blender or other 3d software and map the uv to this shader's texture.
     
    chingwa likes this.
  33. Escope12

    Escope12

    Joined:
    Dec 27, 2017
    Posts:
    14
    I want to bake the eye effect into a texture. How do I do that in Photoshop?
     
  34. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    862
    You can't do it in PS, but you can write a shader to gather pixel color info from each uv coord. But why do you want to bake the results into a texture? A single texture won't have the parallax effects and the eye bulge effects in this shader. Why not directly use this shader and feed it custom textures to make them look like what you want?
    I just don't see the reason here.
     
    chingwa likes this.
  35. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @Harekelas is correct. The shader is there specifically to render the special eye refraction and parallax effects. This cannot be imported into photoshop.
     
  36. Escope12

    Escope12

    Joined:
    Dec 27, 2017
    Posts:
    14
    So what should I do?
     
  37. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    I don't understand what you are trying to do. What is the reason that you aren't using the included eye prefabs (model/shader/texture) as intended?
     
  38. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784


    Hello All,

    I'm happy to announce that Eye Advanced version 1.1.0 is now ready for download...

    Download Here: http://www.tanukidigital.com/download

    This update adds support for both the HDRP and URP render pipelines. This was a much requested feature, and has been a long time in coming. I hope it helps to make your SRP transitions a bit easier. 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.

    In addition to adding SRP support,here was a small fix for the overall brightness setting behavior, and I removed the old Unity 4.0 shaders from the package since they are over 5 years old and outdated by today's Unity standards.

    Version 1.1.0 is also now available on the Asset Store.

    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.0
    ------------------------------------------
    - Added HDRP Support (see _SRP folder for details).
    - Added URP Support (see _SRP folder for details).
    - Fixed Overall Brightness setting so that it now applies properly to albedo again.
    - Removed Unity 4.x version of shaders from package
     
    Last edited: Jul 2, 2020
    timbokoppers and hopeful like this.
  39. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    hello @chingwa
    I tried importing Eye Advanced into a 2020.1 beta project with HDRP 8.1 and the overall Brightness seems to be off in that version of SRP. The shader is drawing and everything, but the eye stays almost completely black, no matter how much I increase the light intensity. Have you got any suggestions, what one can do about that?
    Greetings!
     
  40. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @ElevenGame Thanks for the report! Unity beta releases always seem to have weird stuff going on, which is why I don't typically pay attention to bugs until the official release is out. But I'll take a look at 2020.1 on my end and see if I get a similar issue.
     
  41. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @ElevenGame I can only recreate this issue in the Demo scene that comes with EyeAdvanced. It seems related to the 2 demo "controller" scripts that are on the scene camera. With those disabled the light and brightness then works as expected. Also when I try the eye in a different beta HDRP scene the brightness also works as expected. Is this what you are seeing on your end?
     
  42. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    @chingwa thanks for investigating. Disabling the controller scripts did not help in my case. But i found out that adding correct volume overrides to the scene with visual environment and sky fixes the issue for me. (I don't know why the hdrp default settings did not achieve that..) So the eyes are looking good now even in 2020.1 beta.
     
    chingwa likes this.
  43. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    Great, glad to hear it’s working now!
     
  44. GuitarBro

    GuitarBro

    Joined:
    Oct 9, 2014
    Posts:
    179
    Hey, was considering picking Eye Advanced up and was wondering if there was anything included for tear line rendering or if that's an exercise left for the buyer?
     
  45. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    Hey @GuitarBro thanks for your interest! Considering that tear lines are usually very dependent on the face model being used (and the overall eye opening shape), this is necessarily left up to the end user.
     
  46. GuitarBro

    GuitarBro

    Joined:
    Oct 9, 2014
    Posts:
    179
    Ok, thanks. Makes sense, just wanted to know what all I would be getting beforehand.
     
  47. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    hello, i'm thinking about buying this Asset here ^^

    I have the following situation: I have a realistic character and I want to give them beautiful eyes with this asset here, because the original texture / material doesn't look as good as I would like.

    now my question: are there no problems with the UVs of the eyes ? If I apply this Material from the Asset to the original eyes, aren't there problems with UVs then ?
     
  48. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    @w0rks-Dev It is recommended to not just apply the material, but to use the included eye prefab object as well... replacing your character eyes. In some cases it may be possible to use the material as-is, but it expects a particular mapping for the eye object, and you'll likely find even a small mismatch in the eye-object UVs will cause the EyeAdvanced material to not display correctly.

    You can see a few posts up about a successful remapping of existing eye coordinates:
    https://forum.unity.com/threads/eye-advanced-realistic-eye-shader.299760/page-4#post-5334102

    But again, in most cases it's recommended to just replace the existing eye objects completely.
     
  49. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    yes, but then I can't do anything with it :( . . i am not at all familiar with UVs and i'm not the modeler either...
     
  50. w0rks-Dev

    w0rks-Dev

    Joined:
    Feb 28, 2018
    Posts:
    61
    when i buy it,. . can I then exchange the model in blender ?