PDA

View Full Version : Fake Eye Refraction for Viewport.


Scruples
12-31-2010, 07:36 PM
This is something I have been sitting on for a while.

Fake eye refraction for viewport,

http://img442.imageshack.us/img442/9454/eyeballrefraction.jpg (http://img442.imageshack.us/i/eyeballrefraction.jpg/)

Some people should be able to understand what is going on at a glance but
for the people that don't.

To get the fake refractive lens I took the dome that is indented into the eye (Iris), froze the normals and inverted its shape before reversing the faces.
This way when BackFace Culling is turned on I only see the Fake Refractive lens at the more extreme angles, and by freezing the normals it will mirror the Iris in the way it reacts to light.

The Cornea is just a disc floating between the 2 domes of the Fake Refractive lens and the Iris, if it is placed on the Iris it will disappear at high angles and be less realistic.

I have also uploaded a Maya scene file containing the eyeball so anyone using Maya can take a look at it. [maya 2009+]


http://www.megaupload.com/?d=RDKAQYOB

I am sure this can be accomplished on a sphere with a shader but until someone makes one for the viewport this is how I will make my eyes.

It is 1260 triangles an eye but I wasn't trying to optimize....even so I think the lowest one may get would be around 150-200 triangles using this method....so def not low-poly.

another picture, shows the different components and the difference, with and without the fake refraction lens

http://img220.imageshack.us/img220/8/eyeballrefraction2.jpg (http://img220.imageshack.us/i/eyeballrefraction2.jpg/)

kodde
01-01-2011, 06:01 PM
I did something similar to this some time back, you might find something useful there.
http://www.polycount.com/forum/showthread.php?t=69802

cman2k
01-01-2011, 11:16 PM
likewise, I worked on something similar for 3dsmax. perhaps it will be of help.
http://www.polycount.com/forum/showthread.php?t=73159

Scruples
01-02-2011, 01:43 AM
Very nice shaders!,

Thanks!, the threads have given me some ideas but now that I see them, I think your shaders are a much better option than this geometry only route.

Still though, my ATI card disagrees with almost all HLSL/CGFX shaders....I don't know if the eye shader will work for me, I guess I should test it.

perna
01-02-2011, 07:40 PM
If you're using normal maps you can just make the hipoly that way and bake as usual, no special shaders or tricks needed. Been doing that since the dawn of times of the dawn of the times and it looks good.

Scruples
01-02-2011, 10:17 PM
It doesn't fall apart at the high angles like the normal map method. Although I have to admit It looks exactly the same 99% of the time as the normal map way, its just that 1% when you are looking at a person from the side it would help.

http://img706.imageshack.us/img706/6369/example3u.jpg (http://img706.imageshack.us/i/example3u.jpg/)

http://img190.imageshack.us/img190/66/example4q.jpg (http://img190.imageshack.us/i/example4q.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)