I'm working on an eye shader. It renders quickly, firefly-less and looks fairly good, but I hit a roadblock and could use some help here.
The eye uses a single sphere instead of being broken into into cornea, iris and pupil. I opted to avoid transparency or glass shaders to keep the noise down. The pupil is nothing but pure trickery.
The Reflection
coordinate yields impressive results. The eye behaves as if the pupil were inside it. This method is superior than painting a black circle on the surface of the eye, as that would be glaring obvious from obtuse angles.
It's also an one trick pony, because the texture coordinate > Reflection
output position is "fixed". It would be perfect if it were fixed relative to the object, but no, it seems to be anchored in the world. As soon I rotate my mesh it's gone, just as in the crow's right eye, where the pupil, always facing the same direction, is turned to the head inside.
How can I recreate this effect without taking the traditional route of modelling iris and pupil separately? I'm really pleased with how clean and fast this shader is. Is that possible to anchor the reflection
in the object instead of the world? I tried to use vector transform
with unsatisfactory results.
P.s.: This model is built on top of this one, I'm just improving it for my own needs. All credits should go to the original creator.