How to Make Leaves Animation in Wind by using ShaderGraph in Unity URP

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in last video we made the tremolo in blender and imported it into unity so we read the leaf shader in this video i will show you how to make the leaf animation you win by using shader graph in unity urp first we need to install urp package click window package manager input universal in search field so we get universal rp click the install button at right hand corner after install finish we need to create a pipeline i set in project window under asset folder choose create rendering universal render pipeline pipeline asset then click the pipeline i set modify the pipeline settings in the inspector window [Music] check hdr under quality settings choose full time anti-aliasing under shadow settings check soft shadows under post precision settings set grading mode to high dynamic range then click edit project settings select the graphics on the left tab [Music] in scriptable runner pipeline settings choose the pipeline asset we just created back to the scene we can see the materials become roots red we need to upgrade them to urp materials click edit render pipeline universal render pipeline upgrade project materials to universal rp materials in the pop-up window click proceed now the ground and the tree trunk have right materials we still need to remake the leaf shooter in urp before that set up the poster processing effects in here arquino right click choose volume global volume in its inspector window click new button to create a new volume profile then let's add bloom effect and modify its properties add tool mapping effect select easy yes mode [Music] add color adjustments to modify its properties the last one is white balance effect [Music] let's modify the camera properties check post processing here to make sure post precising work on the game camera choose smaa for anti-aliasing so we make the leaf shooter under ss materials right click choose create shooter pbr graph name it to leave urp double click it to enter shader graph editor let's add texture and color for the leaf click plus here create a texture 2d property name it to main text set its default texture to leave [Music] then add a color property select a color for leaf [Music] click the settings button on the pbr master node check two-sided for both rendering front and back faces then press space to create a new node input texture choose sample texture 2d connect the alpha output to pbr master's alpha input here we use texture color to multiply color property connect the result to air battle you can just use color or textures color as air battle [Music] set the smoothness to zero our collusion to 1.5 the alpha clip threshold is zero we need to set it to 0.5 create a vector 1 property name it to alpha cutoff set its default value to 0.5 change mode to slider then connect it to arf clip threshold now we can see the leaf shape click save asset back to the scene check the result here don't forget drag the shader we just created onto the leaf material okay now we have already achieved the same results with what we did in last video back to shooter graph let's make the leaf animation includes vertex animation for leaves movement and a uv animation for leaf vegal for vertex animation we will use vertex word position x z components as uv to add an offsite which changes over time so use a uv offsite sample our noise texture to get the vertex word offsite press space to create a position node choose space to work then use a split node and a vector2 node to get its xc components then connect x z to a simple noise nodes ui input set its scale to two now we can see the noise will not change over time we need to give the ue offsite [Music] let the uv add an offsite and give the result to noise ue add a vector2 property name it to win direction set its default value to 1 0. add a vector 1 property namely to wind speed then add one more vector 1 property damage to wind strength side wind speed deformed value to 1.2 set its mode to slider mean value is 0 max value is 2 window stress default value to 0.2 set its mode to slider mean value is 0 max value is 1. [Music] drag wind direction down normalize it multiply with wind speed and time let it changes over time [Music] add this offsite with uv above now the noise changes over time let's check this again here we take xc components of vertex word position as ue win the direction multiply wind speed multiply time as off-site add a ue and off-site add vertex word position and a vertex word offsite to get vertex word position after offsite [Music] here we can see the masters vertex position input is object space so we need to transform the position from word space to object space create a transform node select word to object then connect it to masters vertex position input now the vertex offsite is too large we will use wind stress to control the vertex offsite let the noise output multiply wind stress to the address vertex position the vertex soft side looks normal now let's arrange these notes click save asset back to the scene we can see the leaves movement change the material properties to check the result relax offside too large when wind stress is one back to shader graph change the width stress max value to 0.5 next we will give the leaf texture a wiggle animation let the leaf texture rotate around the center to achieve the effect [Music] here we use the uv oxide we just made connect it to a simple noise node change its skill to 8. different ways vertex animation here we use wind speed to control the wiggle lets the noise output multiply wind speed give the output to a rotate nose rotation input let uv rotate around the center point [Music] then connect uv to main textures uv input we can see the leaf texture wiggling [Music] at last let's group these notes [Music] [Music] do click save asset check the result okay that's all in this video hope it could help you thanks for watching
Info
Channel: LoBeyJon Game Dev
Views: 39,724
Rating: undefined out of 5
Keywords: Stylized Tree, Animated Tree, Cartoon Tree, Toon Tree, Ghibli, Unity, URP, Shader Graph, Wind, Animation, Vertex Animation, UV Animation, Leaf Wiggle, Leaves, Wiggle
Id: b_jLZ2_S6jE
Channel Id: undefined
Length: 13min 31sec (811 seconds)
Published: Sun Mar 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.