Home Technical Talk

"next-gen" eyes

1
polycounter lvl 14
Offline / Send Message
poopinmymouth polycounter lvl 14
Wrote up a quick how-to for eyes using what I learned on the feature film I was working. Quite pleased with the results.

http://www.poopinmymouth.com/process/eyes/ng_eyes.htm

ng_beauty.jpg

[ame=" "next-gen" eyes[/ame]

ng_construction.jpg

Hit the link for the full writeup.

Replies

  • Ged
    Offline / Send Message
    Ged interpolator
    cool tutorial, thanks! do the eyes have to be so high poly in order for the specular/reflection to work right?
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
  • Torch
    Offline / Send Message
    Torch greentooth
    Bookmarked, cheers mate!
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 7
    Pretty nifty, cheers!
  • pabgo
  • sprunghunt
    Offline / Send Message
    sprunghunt greentooth
    why not just do the reflection in the shader with a world aligned texture rather than having two layers of geometry and the resultant performance loss?
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    Because, this is a solution for people like me who don't know how to write shaders, but want to have nice looking eyes for our portfolio pieces. I've worked at studios where we had very nice eye shaders, and I know there are engines with good solutions too. This is not about performance, but just emulating what's possible in real time at home with no technical support but yourself.

    If you want to write a nice shader that works in max and is easy to use, feel free and post it here. I want it. :-) Not quite sure what you mean about using a world aligned texture, because without parallax, you're not going to get the look of refraction where the highlight hits a "lens" while the iris is visible from the side.
  • EarthQuake
    Any reason to use alpha(test) on the eyebrows? Seems thats more expensive/looks worse than traditional texturing.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 7
    EarthQuake wrote: »
    Any reason to use alpha(test) on the eyebrows? Seems thats more expensive/looks worse than traditional texturing.
    What do you mean? Like stands of poly or something more complex and intricate that only you guys at 3PS know about?
  • EarthQuake
    Ace-Angel wrote: »
    What do you mean? Like stands of poly or something more complex and intricate that only you guys at 3PS know about?

    Lol no, just texturing the eyebrows flat on the model, its not like eyebrows stick out 2 feet or anything, at most you would just have subtle bump in the lowpoly there. No need for transparency or anything like that.

    Maybe for a pink-floyd game where you shave off your eyebrows?
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    That part isn't done yet, but had some spare time to mock it up. I am going to be using a 2nd layer and actually texturing it better, so I can have anisotropy, and a higher texture resolution than the underlying texture.

    And it's not 1 bit alpha, for whatever reason when using Xoliuls shader on my machine, soft alpha still makes the black areas slightly visible, so I have to enable clipping with a .1 cutoff. It does have a soft edge, but it's behaving wonky on this one shader for some reason.
  • Zwebbie
    Couple of things:

    - Why on earth did you model the pupil as a little pocket? It's 100% black, with no specularity, there's absolutely no way you can actually see the depth without wireframe being on. All it's doing is making your circular shapes wobbly.

    - Eyelashes are, in my experience, more irregular, crossing and clustering. Reference.

    - AO LAYER! There's no point making correct eyes if they don't appear to be in the eye socket. Here's a small comparison image of eyes I made the other day with and without an AO layer (FWIW, they're completely round eyes with no separate specularity layer) and Massbot explains them in his tutorial. He places the tear duct on the AO layer too, which I think might be a good idea to help that transition.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 7
    -That's the new standard many game dev's are using and movie studios (see Crysis).

    -Some people like to keep their lashes nice and organized ;)

    -I don't think X-shader allows for AO layering in shader format, which is the proper way to go about in this day and age.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    Zwebbie wrote: »
    Couple of things:

    - Why on earth did you model the pupil as a little pocket? It's 100% black, with no specularity, there's absolutely no way you can actually see the depth without wireframe being on. All it's doing is making your circular shapes wobbly.

    - Eyelashes are, in my experience, more irregular, crossing and clustering. Reference.

    - AO LAYER! There's no point making correct eyes if they don't appear to be in the eye socket. Here's a small comparison image of eyes I made the other day with and without an AO layer (FWIW, they're completely round eyes with no separate specularity layer) and Massbot explains them in his tutorial. He places the tear duct on the AO layer too, which I think might be a good idea to help that transition.

    How do the eyes you linked (tiny image btw) look from the side? It's pretty easy to get eyes that look good from dead on. Are you using parallax, or do they just fall apart from an angle. Do the irises on yours catch light on the bottom as well? That's why using either a separate indented iris works well, or some kind of in shader parallax.

    You're right in that the pupil doesn't need to be extruded. I use geometry for it though so you can rig the verts to a bone that you can animate the scale on for pupil size changes.

    The lashes are mostly straight because they can survive as clear delineated lines at a smaller texture resolution. More jaggy and overlapping can appear too clumpy or thick, especially for a guy. Ultimately it's a stylistic thing, this is just a technique that anyone can use with whatever eyelash style they want.

    Also did you really need to be scathing? We're all here to (presumably) help each other.
  • JacqueChoi
    Offline / Send Message
    JacqueChoi interpolator
    I could see pupil dillation as a really good thing actually.

    It's a good tutorial, and I'm glad you shared. I wish more people would post their eye tutorials, because everyone seems to do them differently.


    I'm sure we could jsut as easily shit on everyone else's methods as well.
  • Zwebbie
    Firstly, if I came across as scathing, you have my apologies - that was never the intention. There are few people to whom I owe as much in CG as you, and I do respect you greatly. Now, then...

    The eyes I made don't really hold up from a side view, as you suspected. That was mostly a case of couldn't-be-bothered; game characters rarely show their faces up close from the side, and I wasn't sure how I'd deal with the gap that arises when the iris meets the eyelid. I believe Vig (edit: = Mark Dygert) mentioned in another thread that round eyeballs are just much easier on the riggers, because they don't have to take deformation into account.

    Concerning the pupil, that's actually a very clever idea to have a variable size! That said... you could do that just as well with a flat pupil, couldn't you?

    Anyway, my main point was really the AO. You've got nice eyes, but they don't look like they belong in the face because they're not getting darkened by a layer of brow ridge, eye lids and lashes, and that just looks... creepy, if you ask me.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    Zwebbie wrote: »
    Anyway, my main point was really the AO. You've got nice eyes, but they don't look like they belong in the face because they're not getting darkened by a layer of brow ridge, eye lids and lashes, and that just looks... creepy, if you ask me.

    They actually are being darkened, but the soft shadows from xoliuls shader are not very dark, nor do they do really tight fine detail. However they are shaded, and they do look much more floaty with shadows turned off.

    A projected AO shadow is the way to go, and have worked with ones like that as long as five years ago, but with this particular setup, the AO shell would be penetrated by the lens geometry. So while I agree a proper darkening would work, it's something that would require a special shader, or foregoing the lens affect, which I think has a much better visual affect than the darkening fake does.

    Zwebbie wrote: »
    The eyes I made don't really hold up from a side view, as you suspected. That was mostly a case of couldn't-be-bothered; game characters rarely show their faces up close from the side,

    Also you'd be surprised how important this refraction effect is for the eyes to look good. Mapping on a standard sphere with no parallax effects is very "last gen" and doesn't look nearly as good. Even a floating white disc with a look at orientation to the light (for fake specular with no alpha), over top of a sphere with an indented iris looks better.
  • [Deleted User]
    Offline / Send Message
    [Deleted User] insane polycounter
    The user and all related content has been deleted.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 15
    Thanks for the tutorial. Looks nice.
  • Ben Cloward
    Offline / Send Message
    Ben Cloward polycounter lvl 14
    Very nicely done, Ben! Great tutorial.
  • Gestalt
    I think the AO layer is really important and would help a lot here, but at the same time I've been reluctant to use extra geometry and opacity for the effect since it can be costly.

    On further thought the upper eyelid follows the movement of the eye, so having the AO based on the actual texture of the eye itself (sort of baked on) rather than a floating layer, may actually work out if the eye is rigged well with the eyelids. You can't really do it for the lower lid (when you look up the lower lid doesn't follow as much as the upper lid does), but at the same time the effect is most noticeable under the upper anyway.

    The biggest difference for me is when you view a face from a distance. If the eyes don't have the AO, and the right amount of shading, they look bright, bug-eyed and uncanny. Same if the specular is too intense (or they're constant floating white highlights...)
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    Gestalt wrote: »
    I think the AO layer is really important and would help a lot here, but at the same time I've been reluctant to use extra geometry and opacity for the effect since it can be costly.

    On further thought the upper eyelid follows the movement of the eye, so having the AO based on the actual texture of the eye itself (sort of baked on) rather than a floating layer, may actually work out if the eye is rigged well with the eyelids. You can't really do it for the lower lid (when you look up the lower lid doesn't follow as much as the upper lid does), but at the same time the effect is most noticeable under the upper anyway.

    The biggest difference for me is when you view a face from a distance. If the eyes don't have the AO, and the right amount of shading, they look bright, bug-eyed and uncanny. Same if the specular is too intense (or they're constant floating white highlights...)

    Yep, it's really a balance, because you can potentially have far too many layers of alpha. The ideal solution is alpha planes for eyelashes, and then a shader that uses parallax to indent the iris, outset the specular shine for the lens, and a projected AO all on one sphere. I've had that setup in-house before, but I am currently unable to figure out how to get it working in max that way, and I personally prioritize the specular layer over the AO, so I dropped it. I totally agree with you about overwhite eyes, though I find often that's just from artists making eyes "white" as in 255,255,255 rather than a tone very similar to the skin.
  • darthwilson
    awesome! Ima gonna try replicate this in unreal!
  • Mark Dygert
    I haven't read the thread yet but here are a few notes, I apologize if these have already been covered...

    1) In general (not saying you do this), don't screw with the spheres original pivot point.
    Once you edit the eye and make the shape non spherical it makes it hard to get the eyes to rotate properly. When I'm rigging I use the original pivot position to align eye bones as do a lot of animators and riggers.
    "But I always reset xform on all of stuff and recenter pivot points after moving elements instead of objects! I'm a riggers best friend!"
    Yea well in cases like this is makes another job harder.

    1a) The work around for when modelers screw up the pivots:
    Hopefully there is at least one vert left in its original position, so you can snap another sphere to it, then realign the pivot of your eye, to match the un-butchered sphere. Pain in the ass and totally avoidable, but works... if they didn't totally screw with the eye...

    2) Anatomical correctness can be problematic.
    The bulbous bulge in the cornea can easily clip into the eyelids and cause problems, especially once you start moving verts around in animation. Sure zoomed it when compared to an anatomy chart looks great but zoomed out at distance players notice the clipping a lot more.

    The iris indent can be annoying and distracting to players, much more so than the lack of the indent.
    EyeHateYou.jpg
    2a) Sure you can put some extra geometry around the eyelids and double wall the eyelids but the eyes are pretty dense and that can be a lot of polys that will never be seen. If you're using a geosphere to save polys then you don't want to add a few loops to the inside of the eye socket to prevent the indent from being an issue like above.

    2b) If you do double wall the eyelids can be difficult to weight if modelers are not careful about aligning the verts in the double wall. The inner wall could clip during animation. If they are aligned properly weights can be copied and pasted and the chances of the inner wall poking through drop, but don't go away...
    DoubleWalledGeo.jpg

    2c) The chances that anyone will care about the iris indent, are pretty low. If it's really important, a normal map will probably fake it well enough without running into the above issue and there is probably already one applied to character's anyway so...

    3) Trim those opacity planes a little tighter.
    If the geometry is set to cast shadows you'll get big dark areas that do not represent what people are actually looking at. In the example above its causing an issue in the viewport. If it was trimmed tighter, the problem would still be there but not as noticeable and the father back you get the easier it becomes to live with.

    3a) Opacity accurate shadows can be expensive and on something so small as eyelashes and eyebrows it's not worth it. If you have big opacity planes models get dark bushy eyebrows or dark circles.

    3b) The double walled z fighting, issue pops up again. With something so tight and easily faked with a normal map, why add something as complex and troublesome as opacity planes? There is probably enough opacity in the hair on normal characters to make things slow down.

    3c) A little extra geometry that culls problematic transparent pixels from the scene while helping to cast a more accurate shadow is a lot better than saving a few tris.
  • Neox
    Offline / Send Message
    Neox ngon master
    2) Anatomical correctness can be problematic.

    the problem starts right here, it isn't anatomical correct, its pretty much a fake to create depth to the iris, but it isn't indented

    Anatomy_of_the_Human_Eye-Cross_section_view.jpg


    it is a simple trick to achieve said depth, or basically imitate how light scatters through the iris, it could be done with a shader as well, but as ben said, it's simple to create without any extra knowledge of shadercreation

    i was trying to find the super closeup images i once had of the eye/iris, but i can't find it anymore

    anyways her eis some crazy cool ref if you really want to go into detail of eye animation :P

    [ame=" in slow motion - YouTube[/ame]
  • JacqueChoi
    Offline / Send Message
    JacqueChoi interpolator
    Well the one I wrote about a year ago (embarassing art quality) is what i use is very similar to this.


    www.jacquechoi.com/ModellingRealtimeEyes.docx



    The anatomy isn't necessarily "accurate", but at the same time Ben's technique emulates lens refraction, and how the lighting actually falls on an iris more accurately than a convex shape.

    (pay attention to the specular on the lens, and how the lighting falls on the iris)
    Eye_iris.jpg


    It's a standardized way to 'fake it' (as it's also been used for years by studios such as Pixar, ILM and WETA).

    BugsLifeWallpaper800.jpg
  • Neox
    Offline / Send Message
    Neox ngon master
    yeah i didn't say its a uncommon way to do it, but there are of course more accurate ways :)
  • Mark Dygert
    Neox wrote: »
    the problem starts right here, it isn't anatomical correct, its pretty much a fake to create depth to the iris, but it isn't indented
    I was mostly talking about the anatomical correctness of the bulbous cornea, its really hard to detect even looking very closely at someones eye from the side but yet artist's like to balloon it out and never think about closing the eyelids or moving the eye around with this giant canker on the eye.

    The indented iris isn't anatomically correct I guess, but the indent creates the problems I outlined. If you're going to have the indent then you need to think about how that will effect things.

    Modelers sometimes get stuck looking at a model in one pose frozen in time and sometimes never think about what could happen when it moves. The more artists are aware of these issues the better the end result will be.
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 14
    cool poop, good to see you making stuff again..

    i do things a bit differently. i always add a cubemap to the eye to give it a wet feeling, and i always add a fake shadow under the lid. those two things really make the eye feel a bit more alive and set into the skull. i also exaggerate the thickness of the lid, so the read really well. here is a screen grab, my textures are not that high res, and it doesn't look too spectacular up close but i think it gets the job done from game distance, i focused on forms that would read well.

    eye.jpg
  • Dylan Brady
    Offline / Send Message
    Dylan Brady polycounter lvl 9
    Awesome, Awesome thread. been some great info about eyes the last few weeks.
    one problem I had with my last character was getting the spec to overlay on a transparant surface. but that might have been an issue with Marmoset.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    arshlevon wrote: »
    cool poop, good to see you making stuff again..

    i do things a bit differently. i always add a cubemap to the eye to give it a wet feeling, and i always add a fake shadow under the lid. those two things really make the eye feel a bit more alive and set into the skull. i also exaggerate the thickness of the lid, so the read really well. here is a screen grab, my textures are not that high res, and it doesn't look too spectacular up close but i think it gets the job done from game distance, i focused on forms that would read well.

    eye.jpg

    Looks awesome Arsh. I see you built in more lighting into the eyeball as well, is the lighting of the iris just built in, right?
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 14
    Looks awesome Arsh. I see you built in more lighting into the eyeball as well, is the lighting of the iris just built in, right?

    no i didn't paint in any lighting, but i did use a spec map on the iris, it just has low gloss. its nice to get that glint of spec when the light shines in the eye. it also has a very exaggerated normal map on the iris to make it appear really deep.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    No I mean on the eyeball itself, is all that dark red on the bottom left in the exploded view of just the eyeball, only shading from the shader and lighting? It looks like you took the white of the eye darker and redder toward the back and bottom.

    On the iris I'm asking how you're getting just the bottom to catch light. Is that vert indented? or is it flat with a normal sending it inward? Or is it you only have the spec map bright on the bottom of the iris?
  • cryrid
    Offline / Send Message
    cryrid greentooth
    To the wiki with this stuff.
  • chakkrit
    This is pretty neat and very useful for the project I'm working on at the moment. I was making eyes based on v8matey's design and was gonna try and keep shader work to a minimum. Thanks for the semi-tutorial.

    Hope you keep the bakery idea going, it sounds really cool. There is something in a similar sort of vein here in the UK...I'll drop in the link in case you fancy a look.

    http://www.graze.com/
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 14
    oh yeah for the red its painted, and approaches a flesh tone for the "white" of the eye, i use a flesh tone for the white so the highlight really pops at all times.

    for the iris, its an exaggerated normal map, the geo is flat. another trick to get them to pop and look really good in game is to use a slightly desaturated diffuse texture for the color of the iris, and a vivid specular color, this will give them a bit of twinkle. if you look where the light is hitting my iris its much more saturated that where it is not. this works well for colored eyes, like blue and green, and even is nice for brown if you pump the spec color toward orange.


    i also used this technique for the lead character of resistance 3. here are some shots ingame from the engine.

    cap.jpg
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    arshlevon wrote: »
    oh yeah for the red its painted, and approaches a flesh tone for the "white" of the eye, i use a flesh tone for the white so the highlight really pops at all times.

    for the iris, its an exaggerated normal map, the geo is flat. another trick to get them to pop and look really good in game is to use a slightly desaturated diffuse texture for the color of the iris, and a vivid specular color, this will give them a bit of twinkle. if you look where the light is hitting my iris its much more saturated that where it is not. this works well for colored eyes, like blue and green, and even is nice for brown if you pump the spec color toward orange.

    Cool, thanks for 'splainin.

    *edit* damn that looks good, face and eyes. :-)
  • barnesy
    Offline / Send Message
    barnesy polycounter lvl 9
    Thanks for the share. I wounder how this technique translates to UDK :)
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 14
    greatest thread
  • Bigjohn
    Offline / Send Message
    Bigjohn polycounter lvl 9
    What's the projected AO you guys are talking about? I never heard of it before.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    Imagine a "planar UV projection" that stays with the eyeball at all time. So even though the eye is spherical, and can rotate around to look at things, this darkening pass is projected straight onto it, so it will always have the shape of the eyelid. The only time this falls apart is if the character squints and blinks, but just like with all solutions, 90% of the time it looks good.
  • ZacD
    Offline / Send Message
    ZacD polycounter
    Peoples eyes tend to have a slight shadow on the top rim of their eyeball, I'm not sure if its just a shadow from the eye lashes, but it makes the eye intergrate with the eye lid a lot better, and looks 10x less cg that way.
  • Bigjohn
    Offline / Send Message
    Bigjohn polycounter lvl 9
    oh I see. That sounds cool.

    So does anyone have any info on how to pull that projected AO thing off? Are there any examples of that in-use?
  • ZacD
    Offline / Send Message
    ZacD polycounter
    Animation wise? or what are you worried about?
  • Bigjohn
    Offline / Send Message
    Bigjohn polycounter lvl 9
    No, I just mean how is it implemented. I'm assuming it's some sort of shader setup.
  • ZacD
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 14
    He was specifically asking about a projected AO solution since it doesn't have the alpha sorting problems, as it's just overlayed onto the texture.

    I was in the middle of getting one for GUN2 at neversoft, but the project got canceled and then I left before we got it working. I was just using a shell like Arshlevon's example in the meantime.
  • ZacD
    Offline / Send Message
    ZacD polycounter
    Oh I was confused XD
  • JacqueChoi
    Offline / Send Message
    JacqueChoi interpolator
    John: The way I implement that AO curtain use it in The Secret World (even Rango & FarCry 2), I applied them into a 'multiplicative blend mode', that way it's not sorting at all, or requires any Z-buffering or lighting.

    Also you can colour it reddish-brown so it multiplies more of a fleshier colour.

    Similarly with the specular/reflection used on the outer shell. It's a LOT more efficient putting it into an additive blend mode.

    The addition of both of these draw calls are very negligible as neither are sorting, or even being buffered in Z.



    One final thing I think we all forgot to mention, was to remember to include some kin of SSS solution for the eye.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 7
    Half Lambert with, with an Exponent control, and Lerp for the fall off color for SSS solution.

    Multiply AO over total diffuse/total spec and control it via a constant.
1
Sign In or Register to comment.