Create Stunning Outline Post Process Shader In Godot 4!

  Рет қаралды 1,383

Digvijaysinh Gohil

Digvijaysinh Gohil

Күн бұрын

Пікірлер: 19
@gallo123
@gallo123 3 ай бұрын
ALSO, to make the outline pop out of the mesh instead of going inside it, multiply by (-1) the result of the DepthVS function before returning it. :)
@juanestban
@juanestban 3 ай бұрын
thank man! you are amaizing, i was having troubles with the thickness 'cause I had "0" on the thickness_outline
@Infinte_log
@Infinte_log 3 ай бұрын
Good video 🎉.
@iDigvijaysinhG
@iDigvijaysinhG 3 ай бұрын
Thanks
@gallo123
@gallo123 3 ай бұрын
This is for version 4.3+ of Godot btw, I had to update to see the effect (I was using 4.2)
@iDigvijaysinhG
@iDigvijaysinhG 3 ай бұрын
Hey, Yup I did use 4.3 in the tutorial, but I don't see why we can't use in 4.2. Maybe you need to tweak the line on vertex processor. Something like "POSITION = vec4(VERTEX.xy, 0, 1);" should work.
@flynsarmy
@flynsarmy 3 ай бұрын
Thanks for the tutorial! A common usecase in third person games is to outline the object your char is looking at. How would you adapt this to only highlight specified objects in your scene?
@iDigvijaysinhG
@iDigvijaysinhG 3 ай бұрын
Hey, thanks! And I believe that this approach is not well suited for the said requirement. To highlight specific objects, I would still use my earlier simple outline approach. I have a video about that in Unity but it can easily be converted to use in Godot.
@flynsarmy
@flynsarmy 3 ай бұрын
@@iDigvijaysinhG A Godot version would be wonderful!
@iDigvijaysinhG
@iDigvijaysinhG 3 ай бұрын
@@flynsarmy It is easy enough. Basically in vertex processor you just do VERTEX * outline_scale. In fragment processor you can apply color. Also make sure you are only rendering the back faces. And apply the outline material onto the "next pass" of the original material.
@jafarrolo
@jafarrolo 3 ай бұрын
Thank you, but would it be possible to have a video or an explanation on how to translate this in a compositor effect at the level of WorldEnvironment for example? I'm trying to understand those better but I still can't get the grasp of them.
@iDigvijaysinhG
@iDigvijaysinhG 3 ай бұрын
Hey, coincidentally I just uploaded the video yesterday covering the Compositor Effects.
@jafarrolo
@jafarrolo 3 ай бұрын
@@iDigvijaysinhG I watched it but they're still a little bit obscure to me, maybe because I lack the knowledge about compute shaders. I also tried this one since I'm in need of it for a project and it's weeks that I'm trying to implement a good outline shader, and while it is wonderful and really thank you for your work (I'm currently starting to watch little by little all of your videos to understand shaders better, I've seen the compositor and the outline one for now) in the current project I'm working on some of the outlines appears only from a distance. For example I have a lamp that is slightly squared, with round corners, if I look at it from 2-3 meters it looks properly with an outline on the lamp and nothing else, but if I look at it from a distance it starts to draw an outline where there is the rounded corner, do you have any idea what the reason could be? It happens also that the outlines are draw above Sprite3D nodes but only if I look at the Sprite3D from a little bit far away, no idea why this happens and I think the two things are related. EDIT: I just resolved the issue with the Sprite3D by setting the "Alpha Cut" to "Discard" but I'm not entirely sure why it worked 😅
@ConsularAtol
@ConsularAtol Ай бұрын
I'm unfortunately having issues with this shader when used with orthogonal cameras, it just simply doesn't work with them specifically. Any fix for this?
@iDigvijaysinhG
@iDigvijaysinhG Ай бұрын
In orthographic projection, depth is usually stored linearly so after reading the depth from depth texture, you don't have to make it linear. At 4:55 you can directly return depth.
@ConsularAtol
@ConsularAtol Ай бұрын
@@iDigvijaysinhG That works splendidly, thank you so much!
@OhDangTheJam
@OhDangTheJam 2 ай бұрын
Hey thank you very much for making this video. I have tried every shader I can find for a simple outline like this, and all of them seem to have some kind of issue. This one is perfect, but I've run into trouble. This shader works perfectly, but only for the first view in the editor. If I add more views, preview the camera view it's parented to, or launch the game, the shader is not working. Any idea why that would be?
@OhDangTheJam
@OhDangTheJam 2 ай бұрын
Oh, I figured it out. It's not compatible with orthogonal cameras. Is it possible to modify it so that it works with orthogonal cameras/all the open views in the editor?
@iDigvijaysinhG
@iDigvijaysinhG 2 ай бұрын
You could try this as a Compositor effect. I do have an introductory video about that topic.
Compositor Effect! Step By Step Setup in Godot 4.3
27:43
Digvijaysinh Gohil
Рет қаралды 2,8 М.
I Made My Dream game In Godot 4... #devlog 1
8:03
PinoPrime
Рет қаралды 277 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 14 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
AI 3D Models Are Here To Stay // Trellis, Meshy, BlenderGPT
14:03
Godot 4 Simple Outline Shader
5:38
Gwizz
Рет қаралды 12 М.
Godot 4 Post Processing: 3D Pixel Art Shader
9:48
Crigz Vs Game Dev
Рет қаралды 78 М.
HOUDINI: Things I Wish I Knew Earlier Edited
15:50
DAMIDIGITAL
Рет қаралды 2,9 М.
Godot 4: Scene Depth Explained
16:44
Digvijaysinh Gohil
Рет қаралды 1,5 М.
I Made a Wave Function Collapse Castle Generator in Godot
25:30
RachelfTech
Рет қаралды 73 М.
I Made an Electronic Chessboard Without Turns
14:32
From Scratch
Рет қаралды 973 М.
Easy Toon Style in Godot
7:39
Watt Interactive
Рет қаралды 20 М.