PixelPerfect: Sketch #20 WIP


#21

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!


#22

Cleaned it up a little bit!

Hope this can inspire some people!


#23

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


#24

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!


#25

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:
Screenshot_3


#26

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


#27

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.


#28

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
https://www.shadertoy.com/view/4dfXDn

image


#29

thank you so much will look into it


#30

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


#31

This is awesome. I’ve translated all these shapes and functions into Amplify nodes and have been playing with them. Definitely very fun and opens a lot of doors for opportunity to do creative things!

Seth