[Godot3] How to outline a 3D object in Godot | Game Dev Tutorial 4

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends in this video I'm going to show you how to outline 3d objects in Godot let's get to it there are two ways that I know of to put outlines on 3d objects the first is called the inverted hull method which is done in the 3d modeling software when creating your object in my case this is done in blender the second method uses a shader material to generate outlines in real time each has certain advantages and disadvantages today I'll show you how to make outlines using godot's default shader and I'll show you how to use the inverted hull method in a future video first I'll demonstrate how to set up the outline effect then I'll try to explain how it works here's the scene we were left with in the previous tutorial and our cel-shaded sphere to add the outline effect click on the sphere node in the scene tree then head to the material property in the inspector click the material at the bottom of the property list find next pass click on the empty field and select new spatial material the next pass property allows us to chain materials together one after another in a sequence in the flag's menu find the unshaded property and press on [Music] under parameters find cull mode and select front further down the list find grow and select on entered the grow amount which is the desired width of your outline finally under the albedo menu you can change the color of your outline [Music] for those who are curious about how this setup is working I'll do my best to explain by using the next pass property Godot is rendering our sphere twice using two different material shaders the first material shades our sphere with our cel shading effect the second material increases the size of our object and turns it inside out so that we can only see the inside faces while leaving the outside transparent this gives the effect of an outline the unshaded property in the flags menu prevents our directional light from affecting our outline setting the cull mode to front turns all the polygons on the object that face the camera transparent while allowing us to see polygons facing away from the camera in effect this allows us to only see the back inside wall of our scaled up sphere object while still rendering the normal sized cel shaded sphere object from the first material paths that lives inside it the grow setting is what tells godot's default shader to scale up the size of the object in the second pass it works by moving each vertex in our object along the vertexes normal vector by the grow amount that we enter [Music] you can apply these effects to any 3d object but my advice is to keep the line with as small as possible otherwise you'll start to get unwanted artifacts unwanted artifacts and outlines applied to your object in unwanted places is the disadvantage of creating outlines using this method to have more control over the outline you'll need to create a custom shader or use the inverted hull method in your 3d modeling software which we'll cover in a future tutorial well that'll do for this video thanks for stopping by if you think this stuff is as cool as I do hit that like button and help this channel grow if you want to see more videos like this subscribe and click the bell icon hope to see you in the next video until then happy dubbing
Info
Channel: Dave the Dev
Views: 19,444
Rating: undefined out of 5
Keywords: Godot, Game, Development, Tutorial, Cel Shading, Toon Shading, 3D Outline, shader, materials, Indie Game Dev
Id: zJzcJ1Jzfdk
Channel Id: undefined
Length: 4min 8sec (248 seconds)
Published: Thu Aug 08 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.