Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eye material type #7247

Closed
santipaprika opened this issue Jan 28, 2022 · 4 comments
Closed

Eye material type #7247

santipaprika opened this issue Jan 28, 2022 · 4 comments
Assignees
Labels
feature/graphics/materials This item is related to materials and the material system. sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.

Comments

@santipaprika
Copy link
Contributor

santipaprika commented Jan 28, 2022

Is your feature request related to a problem? Please describe.
Rendering eyes realistically is hard to achieve with the current material types available in O3DE, because there are many visual features that are specific to the nature of eyes, like the cornea refraction, wetness, pupil aperture, etc.

Describe the solution you'd like
Add a new Eye material type supporting the features mentioned above (among others) and exposing artist-friendly parameters in the material inspector.

Most engines have a specific shader for eyes (Unity, UE, Cryengine).
There are many ways to gather the information necessary to render the eyes properly. I propose the following approach:

  • The eye textures must be iris-centered (see Unity)
  • Use separate textures for the sclera and the iris (see Unity)
  • The eye geometry must be spherical with a bulb in the front part (cornea) or use a cornea-specific normal map (see Cryengine).
  • The iris depth position is exposed to let the user calibrate it properly. Alternatively, the distance between the cornea and the iris could be fetched from a precomputed texture.
  • Use a separate mesh with a texture encoding reflections occlusion (eyelids, etc) and AO (see UE).
  • Use meshes for wetness (see Cryengine).

Simpler parameters to expose:

  • Refraction strength
  • Pupil radius
  • Sclera/Iris roughness
  • Sclera/Iris specularity
  • ...

Describe alternatives you've considered
A workaround to render realistic eyes with the EnhancedPBR material could be to use two separate meshes, one for the cornea (with the bulb) and one for the sclera/iris. An additional pass might be required to apply the corresponding refraction/lighting to the iris region depending on the cornea normal at that point, making the process a bit cumbersome. Furthermore, other features like the pupil aperture would need even more complex operations to be achieved.

@santipaprika santipaprika added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 28, 2022
@santipaprika
Copy link
Contributor Author

I am currently working on this feature (in this branch).

@forhalle forhalle added sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 31, 2022
@superkitcath superkitcath added the feature/graphics/materials This item is related to materials and the material system. label Feb 2, 2022
@superkitcath superkitcath added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Feb 2, 2022
@santipaprika
Copy link
Contributor Author

santipaprika commented Feb 16, 2022

Demo showing the progress on this work:

EyeDemoWeb.mp4

The main reference is the Next Generation Character Rendering presentation by Jorge Jimenez. Also, the eye shaders of other popular engines have been explored to check the parameters being used.

@superkitcath
Copy link

Assigning to you, @santipaprika, as per @thefranke's message. Thanks!

@santipaprika
Copy link
Contributor Author

Closing this as the PR associated to it just got merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/graphics/materials This item is related to materials and the material system. sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.
Development

No branches or pull requests

3 participants