Author : jdvi


Reply
Reply
 
Thread Tools Display Modes
Ace-Angel's Avatar
Old (#1)
Heya people,

Quick question, does anyone have a quick and dirty idea on how one would go about creating an 'internal' bounce of the Specular/Reflection?

Basically I have a sphere mesh, and one part of it is masked to show the reflection, I inverted this reflection 180 to fake the refection, but cannot for the life of me fake the 'bounce' as if it's pushed in internally, it still looks like its 'floating' ontop of the mesh itself.

I tried an inverted my normal map and using a Bumpoffset to try this effect, but no avail.

Anyone have tips? Cheers!
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,501 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Neox's Avatar
Old (#2)
I'm not really sure what you mean could you show a real world example of what you would like to achieve?
bonus vir semper tiro.

Steffen 'Neox' Unger
It's Airborn Baby!

freelance 3d artist
for hire
Offline , veteran polycounter, 3,191 Posts, Join Date Sep 2006, Location Berlin Germany Send a message via ICQ to Neox  
   Reply With Quote

Ace-Angel's Avatar
Old (#3)
A quick example of what I mean:

http://img442.imageshack.us/i/eyeballrefraction.jpg/

Basically, I'm trying to get that internal bounce as seen in the image in shader format, all on a single mesh.

The math in theory suggests that I flip my RG channels of my Normal map with a decent Parallax map, and it should fake the effect correctly. I tried that over and over again, but it seems like inverting my Red and Green channels for said effect breaks my Specular and Cubemap setup.

So I was wondering if any kind soul had any tips or snippets on which they might have the solution.

Cheers!
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,501 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Gestalt's Avatar
Old (#4)
Just a quick idea but if you are using a sphere and making the apparent iris highlight with a normal map the you could use the iris normal map when doing the specular highlight and just mask/fill the eye with 0,0,1 for its normals when doing the environment map (gives you the cornea and rounded exterior eye shape described by the plain geometry). If I get what you're saying you would like to have the iris highlight while also having the cornea reflections. You could use vert color to mask out the eye geometry so you don't need a mask texture.
"Not all those who wander are lost"
Offline , triangle, 301 Posts, Join Date Nov 2011,  
   Reply With Quote

Neox's Avatar
Old (#5)
why would you want to invert your R channel? usually its just G that you need to invert to let the light hit the surface from the other direction as this is your Y vector
bonus vir semper tiro.

Steffen 'Neox' Unger
It's Airborn Baby!

freelance 3d artist
for hire
Offline , veteran polycounter, 3,191 Posts, Join Date Sep 2006, Location Berlin Germany Send a message via ICQ to Neox  
   Reply With Quote

Farfarer's Avatar
Old (#6)
For my eye shader, I just baked two normal maps. One with the iris is plugged in to the diffuse shading, one with the lens bulge is plugged into the specular shading.

It's not physically accurate, really, but it works fairly well.

Flipping the y component would probably give a similar result...
Offline , dedicated polycounter, 1,406 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

LoTekK's Avatar
Old (#7)
I just did a quick eyeball model+nm, and a shader modification to test this out, and I think ideally you'll want a custom shader for the eyeballs. Essentially you're doing a double specular. First specular will use the normal map with the iris indentation, and the second will use the vertex normals. And... that's pretty much it. Obviously the illusion will still break at high incidence angles (whether you have the double specular or not), but it works well enough for a single mesh eyeball.



edit: That should have been reflection instead of specular... read your post wrong :p But the idea's still the same.
FlowMap Painter v0.9.2

teckArtist.com
LoTekK.com

"Has anyone really been far even as decided to use even go want to do look more like?" -DKK
Offline , dedicated polycounter, 1,395 Posts, Join Date Jan 2006, Location Singapore Send a message via MSN to LoTekK Send a message via Skype™ to LoTekK  
   Reply With Quote

Ace-Angel's Avatar
Old (#8)
Hey guys, thanks for all the feedback, and tried all the ideas and they helped. Thanks alot to everyone!

For some reason, inverted Normal Maps don't help (even dented ones) I had to end up 'inverting' my whole formula's for some reason (like my Blinn had to be inverted), I guess it's a UDK issue since that's where I'm doing my shaders, I tried Max and Maya shaders, but they worked alright with inverted Normal channels only.

Also, I just wanted to add that I forgot one thing that made me run in circles, and that is an inverted Diffuse term, if anyone tries it out, you'll know what I mean when you see the results for you pupil :P

Once again, cheers to all and thanks for everything!
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,501 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

JordanW's Avatar
Old (#9)
Just to be clear you're trying to recreate the specular on the iris correct? Why does using 2 speculars with 2 different normals not work? You should have your geometry be the shape of the cornea and use it's surface normals to create your first specular. Then create geometry representing your iris and bake a normal map, then use that as the normal for your 2nd specular.

I'm not sure why you want to invert normal maps or whatever, if you're trying to recreate an eye why not break down what's actually happening in the physical world to create your material?
Jordan Walker
ART BLOG
CGHUB
Twitter
Offline , dedicated polycounter, 1,437 Posts, Join Date Oct 2004, Location Cary, NC Send a message via ICQ to JordanW  
   Reply With Quote

Ace-Angel's Avatar
Old (#10)
I guess I suck at explaining stuff, so bear with me.

I have two Specs currently, one is the Cornea on the Iris (I will call this IC) and and the other is the internal one is for the Iris.

I'm using the math of the bulge of the Cornea as the 'inverted' math to fake the refraction internally, when it comes to the light bounce in the inside, at angles as a buildup for 'wet' light on the internal iris.

The ideal solution as you said, would be for me to simply model in low poly the stuff I need and base it physically, with the proper shaders later on and it would be much more simple, but then I would need another layer that is Translucent for the Bulge, usually bring in it's own issues, like Depth sorting with hair, I still haven't found a solution to that in which I could tell UDK on how much it can clip in distance.

And yes, I have quite a few characters who have their hair ontop of their eye balls, very niche market, but I make it happen baby!

And soft masked is not an option, since I need the smooth keratoplasty build up and scatter of light near the edges between the said rims.

Plus, I also have a dilation setup going for the texture, I'm not too sure how well I can do that in vertex format to fake the stretching of the Pupils details.

Plus, many artists I know tend to be abit lazy when it comes to creating them maps, so I'm trying to explore my options of fallback math for such stuff.

Last edited by Ace-Angel; 05-14-2012 at 07:29 AM..
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,501 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

JordanW's Avatar
Old (#11)
Hm, to clarify I was saying use 1 model for the whole eye and bake 2 normal maps. Then use custom lighting that will do 2 lighting responses, one for the cornea and the other for the iris+scelera. With that solution you don't need translucent materials.
Jordan Walker
ART BLOG
CGHUB
Twitter
Offline , dedicated polycounter, 1,437 Posts, Join Date Oct 2004, Location Cary, NC Send a message via ICQ to JordanW  
   Reply With Quote

Neox's Avatar
Old (#12)
and if you don't have the extra map for texturespace reasons (though it could be the same normals for all eyes in the game) then just bake out the normalmap for the cornea bending out to build the specular, and flip the green channel for the iris bending inwards to create the diffuse shading.
bonus vir semper tiro.

Steffen 'Neox' Unger
It's Airborn Baby!

freelance 3d artist
for hire
Offline , veteran polycounter, 3,191 Posts, Join Date Sep 2006, Location Berlin Germany Send a message via ICQ to Neox  
   Reply With Quote

Ace-Angel's Avatar
Old (#13)
Quote:
Originally Posted by JordanW View Post
Hm, to clarify I was saying use 1 model for the whole eye and bake 2 normal maps. Then use custom lighting that will do 2 lighting responses, one for the cornea and the other for the iris+scelera. With that solution you don't need translucent materials.
Ah right, understood, will do.

Quote:
Originally Posted by Neox View Post
and if you don't have the extra map for texturespace reasons (though it could be the same normals for all eyes in the game) then just bake out the normalmap for the cornea bending out to build the specular, and flip the green channel for the iris bending inwards to create the diffuse shading.
Yep, that's the idea, but for some reason in UDK, when I invert the G channel, it ends up 'skewing' location of the highlight slightly to the side from where the light is coming, rather then inverting it to the opposite location outright as hoped, so I ended up inverting my whole formula, which works correctly now. No idea why this happening, but it's the current work around.
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,501 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Gestalt's Avatar
Old (#14)
Quote:
Hm, to clarify I was saying use 1 model for the whole eye and bake 2 normal maps.
Quote:
and if you don't have the extra map for texturespace reasons (though it could be the same normals for all eyes in the game) then just bake out the normalmap for the cornea bending out to build the specular, and flip the green channel for the iris bending inwards to create the diffuse shading.
or as was mentioned just use the geometry normals 0,0,1 if you are using one piece of geometry for the eye (which is the way to go imo); mask with vert color would be a decent option if you have more to the mesh pieces than just the eye. You could use bump offset (can store a heightmap -1 to 1 in the blue of the normal) to get a refraction type effect applied to the iris texture and spec but not the sclera/cornea reflections so that it appears there are two separate layers even though it's one piece of geo.
"Not all those who wander are lost"
Offline , triangle, 301 Posts, Join Date Nov 2011,  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch