then I would like to create a shader … ^ ^
what I would like done is to dilate the pupils of my eyes, I tried with parallax, but it is not that … someone will have an idea?
Thank you in advance to any one who may be able to give me some ideas
Is there any reason you want to use a shader for this? The obvious solutions are in your mesh or skeleton: scaling a pupil object or the bone controlling your iris vertices.
Try rendering a black screen in a dark room… that should dilate your eyes a bit.
In all seriousness though, how are you rendering the eye? If it’s just a texture, than that would be very hard to achieve. You’d better go with procedural rendering.
this is a android app, I thought about the substance but can not use it because I am forced to work on unity 4.0.1, it is the eyes of animals, which expand when touching their heads
If you provide a screenshot or a detailed description of what you’re trying to render, then people won’t be left guessing. You said pupils at first, but this sounds like you’re talking about cartoon animals and scaling their whole eyes.
it’s not that I do not want to pay, I did more than once, but I want to know how to do, while the stuff I purchased, are things that I do not want to do
What you’d want to do is to get the dot product of the light direction and the eye forward vector (how you supply this is up to you - probably rig it to a bone and feed in the bone’s forward vector to the shader - or at least) and multiply that by the light attenuation value, probably multiplied by the luminosity of the light colour.
That will give you an inverse value for dilation (where a higher result is a brighter light, so the iris is more contracted). Once you have that, you can drive the pupil size however you see fit.
But if you’re doing that sort of stuff, you want reaction times (pupil dilation isn’t instantaneous) and all sorts of other things taken into account (relative brightness and brightness over time, brightness of the light compared to the current ambient value or other lights…)? Seems a little overkill.
dilation of the pupil will not be depending on the light, I just want to dilate the pupil nimporte when, for example when I touch the head of the character, or when I tickled …
right now, I do test … I did a test with bones in the pupil, but it does not suit me, what I’m asking is how to make a shader of pupil dilated by changing uvs coordinates, regardless of whether I should redo this or such thing, because I am testing …