Animal Corssing Curved World Shader Graph - Easy Unity Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] animals crossing is famous for its curved World visuals depends the world are the players moved toward the z-axis or come back to it so in today's video I'll show you how to create this Animal Crossing curved World in Shadow graph in unity 2022. this is rames altaba from binary lunar and let's get started [Music] before we proceed we are proud to announce that we release the ultimate 2D and 3D Shader graph course for Unity you can get that course now on udemy for great discount this course contains my whole experience during the three years of creating Shader graphs it's suitable for everyone from the beginners to intermediate level and it will guide you with steady steps to create awesome visual effects in your video game it contains 13 projects which has been explained in details to increase your knowledge so enroll today and enjoy the great discount which I provided down in the description [Music] so I have started the scene with the following so this asset I used to create the environment is called the free Skybox extended Shader I imported that then I replaced the terrain with a Terrain that I created and duplicated some assets like the trees the fences and the grass in the scene to create a large scene then I used the quirky series to create this cute gazelle and also I added some movement script so we able to control our player in the scene and finally I added the cinemachine package then added the cinemachine brain to the main camera then I created a virtual camera and name it player camera I set it to follow our player the gazelle and I have set in the body the mode to farming transposer set the rotation to 30 degrees on the X and increase the offset from 0 to 0.2.5 so now as you can see we can play the game and walk around so now the scene is ready to create and apply the world curving Shader graph it's very simple share the graph so let's create it let's create a new Shader graph urp lit Shader graph and let's name it World band and let's start by the camera position node because we will compare each vertices to the distance from the camera then we bend them as we go further or far from the camera so here is what we'll do we'll start with the camera node and gain access to the position of the camera then we deducted or subtracted from the position of the vertices so we create a position node in the world space so we subtract the position from the camera position to get the distance so the distance in our scene represented by the z-axis so as we go far away from the camera on the z-axis we start the band so we will split the result of subtraction and gain access to the z-axis by using a split node then to create the curve as we go far from the camera to understand this mathematically I use this website to create the equation and show you the results on the graph so to create a nice curve we power up the X by 2 that will create a U-shaped curve but to flip it we simply multiply it with minus with power up the distance on the z-axis then we create a parameter to control the curve amount so let's create a new float curve command and we multiply it with the powered Z distance after we negate it by getting the negative values so create multiply node negate the curve amount then we multiply the powered the distance with the negated curve amount or we are interested only in the Y position of the points so as we go far from the camera we increase the band and for that we will access we will need only the Y amount of what happened now so we use a vector 3 node and we get only the Y value we keep the x and z 0 we add this amount or the new y or the band amount to the original position of the vertices so we create an add node we add this change in the Y position to the original position and simply we connect the results on the position on the vertex and for rendering our textures we simply can leave it to the color of your game objects doesn't have texture or we simply can create a sample texture 2D and create texture 2D node connect the texture 2D to assemble texture 2D then to control the color we can create main color node or main color property sorry then we multiply the results of the sample texture to the with the main color and Link the results to the base color let's save and go back to the scene [Applause] we have made the mistake we have calculated everything in the world space and we forgot to convert it to the object space so let's create a transform node to instruct to transform the calculations from the world space into the game object so from the world to game object and we're talking about the position then linked out to the position save and now we got things in the right way now we add the Shader graph that we created to a new material then we add the Shader graph that we created to a new material and I applied the same material to all the game objects in the scene just to simplify this example and see the results live so after we applied the material to all game objects in the scene now we can see how we can curve the world let me make sure that I have added that everything including the terrain if we select now the material that we created then change the band amount we can see the world started bending and I forgot to mention that the band amount is a very small amount so in the Shader graph I set the curve amount to a slider between 0 and 0.01 in your scene it might be different based on the distance of the camera from your game object and based on the world size so you can experiment with this value till it reach a satisfying results for your project or video game so as you can see now we can bend the world and as we move forward with the camera we get this nice curvy world [Music] and that's it for today's video If you enjoyed what you watched don't forget to hit like subscribe and the notification Bell to get notified about the next video of course a big thanks to our supporters on patreon who keeps encouraging us to keep publishing such quality tutorials till next video see you soon [Music] foreign [Music]
Info
Channel: Binary Lunar
Views: 8,326
Rating: undefined out of 5
Keywords: world bending shader, curved world unity, animal crossing rolling log effect, animal crossing unity, unity animal crossing, shader graph, shader tutorial, animal crossing world, unity shader graph, unity shader graph tutorial, animal crossing development, animal crossing remake, animal crossing switch, game development, subway surfers, subway surfers unity tutorial, unity shaders, unity shaders tutorial, unity tutorial, unity tutorial 3d, urp, universal render pipeline
Id: QkX1VerPiNQ
Channel Id: undefined
Length: 10min 18sec (618 seconds)
Published: Mon Oct 03 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.