PixelPerfect: Sketch #20 WIP


Oh i just discovered something!

Idk if this is optimal but im multiplying a vector 2 with Sinus time with a float, and then clamping the default value to 1, and max at whatever i want the max blinking should be, so that when its not blinking it will be default, and im putting that into a UV tiling node!

Result below!


Cleaned it up a little bit!

Hope this can inspire some people!


I’m glad that my experiments inspired you

here is my setup for eyes

I’m using noise to randomize blinking, but 2d noise is for shue overkill here, a multiplication of few sines with different frequencies should produce almost the same effect, or even the exisitng tubulence pattern can be used as source of randomness for blinking


hmm, im working in Amplify shader editor and we dont have the “elipse” node, are u familiar with it or know its counterpart? Thanks a lot!


I ha the same problem. I’m using unreal and I figured you can scale the UVs from a certain position. If you know in what Y coordinates your eye is offseted you can use that value to scale your UV form that position. I use this standard function from Unreal:


yeah Amplify doesnt have that, we have scale and offset but that has nothing to do with it i think


You could easily make an amplify function to do that though. That’s all the ScaleUVsAroundPoint is… just some math wrapped into a convenient reusable node.


shader graph sources are open, here you can see ellipse node code https://github.com/Unity-Technologies/ShaderGraph/blob/master/com.unity.shadergraph/Editor/Data/Nodes/Procedural/Shape/EllipseNode.cs

in HLSL it looks like this:

float ellipse(float2 uv, float width, float height){
   float d = length( (uv * 2 - 1) / float2(width, height) );
   return saturate( (1 - d) / fwidth(d) );

If this is interesting for you, I recommend diving deeper into SDF, there a lot more shapes you can draw with math

this shadertoy is a great example of basic 2d shapes SDF



thank you so much will look into it


oh my i never thought about this, thanks for the help