This tutorial is really awesome! The best thing is that you don't just add all the notes and show the result, but you explain the thought process behind it. That's incredibly helpful.
@RVillani5 жыл бұрын
Thank you! I always wanna know the "why", not just the "how". So that's how I try to explain stuff. Because if you know the "why", you might use it to solve something else.
@rexxthunder4 жыл бұрын
I like how you actually explain what each of the parts are doing as you make them. Great job!
@RVillani4 жыл бұрын
Thanks, Rexx! I really appreciate that, as it's the thing I try to focus the most. ^^
@NJoint9 ай бұрын
Man, this is the best tutorial I've watched in a long while. It wasn't just some mindless button-pushing. You made me understand what I was doing. Thanks a lot
@RVillani9 ай бұрын
Thank you for letting me know! 🫶 I really strive to teach the why, not just the how. That way you can get this new knowledge and apply it to a different problem.
@NJoint9 ай бұрын
@@RVillani you nailed it with this one. I shared it to a couple of colleagues. I really hope you can afford to do this more often
@RVillani9 ай бұрын
@@NJoint Thank you for the kind words! I hope so too. I was very frustrated with my latest videos. The audio was bad (don't know how I didn't notice that while editing) and I feel like I'm not explaining things in a clear manner. Because of that I've been holding off on making more content until I figure out why I became so terrible at explaining this stuff.
@IinesySankka7 жыл бұрын
As a newbie in the VFX community, I'm extremely grateful for you doing these. Just wanted to let you know that. You're a huge help. Thank you so much
@RVillani7 жыл бұрын
I'm very happy to help ^_^
@micmacha7 жыл бұрын
I'm relatively new to the UE4 community, and have been looking everywhere for a reasonable tutorial just on post processing and making occluded objects visible in some way. You sir hit the nail on the head. I've subscribed to keep track of you--thank you very much!
@RVillani7 жыл бұрын
Thanks! Just a heads up, I don't post only tutorials, I also do some art stuff using Unreal and post the videos. But I'll soon be back on making tutorials. Gotta make time in between jobs.
@Beriol97 жыл бұрын
Thanks a lot for the explanation! I've looked everywhere for an explanation for outlines, but everybody just shoves the material in your face without any comments. You explained it perfectly :)
@RVillani7 жыл бұрын
Thanks! I'm also not very fond of "do this and that" tutorials. I wanna know WHY to do this and that. Why press this button instead of the other one?
@Beriol97 жыл бұрын
Exactly :) by understanding how it works I managed to modify it to suit my needs, for example making it work with multiple outlines on top of each other (as you mentioned at the end of the video). By the way, I'm looking forward for your next tutorials! :D
@RVillani7 жыл бұрын
Thanks! I'll tru to get back to them, but right know I need to be able to pay the bills, so I'm drowning myself in freelancing. But I still have a big list of tutorials to make.
@erbmur8 жыл бұрын
Dude, you, you are something special. I have been looking for something like this for a very long time now! Modified it slightly to only highlight on things when you are close to them, but wouldn't have been able to do it without you.
@RVillani8 жыл бұрын
Great! Glad I could help! :D It's greatly appreciated if you share it wherever you can! ^_^
@coreythomas27787 жыл бұрын
If you could explain how you did that it would seriously help me out.
@RVillani7 жыл бұрын
You can measure the distance between the object and the camera using the custom depth output. Then, take that value, subract your minimum required distance from it, ceil, clamp to 0~1 then use 1-x (OneMinus) on the result. Multiply that by the outlines alpha. So, if the distance is less than the required (ie., you're close to the object), the result will be 1 and it will show the outlines. If it's any greater (you're far), the result will be 0 and the outline will be removed.
@erbmur7 жыл бұрын
I just used an overlap volume, and have overlap enable/disable custom render
@RVillani7 жыл бұрын
Hahahaha that'll work too XD But for several objects at different locations, you'd need more overlaps.
@fl2603 жыл бұрын
The fact that you explain every detail with that Portuguese accent is brilliant since it reminds me of my jiu jitsu coach. I was bummed out when I saw the length of the tuto at first, but in the end it's totally worth it. Muito Obrigado.
@RVillani3 жыл бұрын
And to think I've been trying to eliminate my accent all these years XD Thanks a lot for the kind words ^.^ Denada :D I hope you learned something new and useful. :D
@chlbrn7 жыл бұрын
Thank you for explaining the concepts and reasons behind this technique. I have watched some videos about custom depth pass and your video is this only one that I fully understand and I achieve the result I have been looking for a long time. Thank you.
@RVillani7 жыл бұрын
And now that you know the concept, you can even do new stuff with the acquired knowledge :D
@mailerdaemon857 жыл бұрын
Hey, thanks for the nice tutorial! I noticed that the outlines flicker a little bit. Just in case someone else wants to get rid of that flicker: In the material settings go to Post Process Material and set Blendable Location to Before Translucency.
@RVillani7 жыл бұрын
Till Mohr Thanks! =D
@alneirfernandes84925 жыл бұрын
GOD
@user-jw9zn1fg9n5 жыл бұрын
THANK YOU SO MUCH!
@pauldead4 жыл бұрын
Thank's man.
@techpaiva4 жыл бұрын
Its saved me!thank brother!!
@DD-zw6qf Жыл бұрын
I had an issue with something I made and couldn't find any information so I decided to watch this video as a break and to learn something new After 30 minutes I saw you did something which was exactly what I was looking for, thank you!
@RVillani Жыл бұрын
Thanks for letting me know! What was it that you needed?
@del1an Жыл бұрын
@@RVillani Rendering the side of an actors with custom stencil that is not behind walls or any mesh (28:07)
@mFurb9883 жыл бұрын
Very clear explanations. One learns about the different components and why their combinations provide the different effects. Thank you.
@RVillani3 жыл бұрын
Thanks, Sven! I believe knowing the "why" besides the "how" helps us create other things from the same concepts.
@mbwilding3 жыл бұрын
You're insane man, thanks for explaining everything step by step rather than just doing it.
@RVillani3 жыл бұрын
Thank you, Matthew! Yeah, man. Sometimes I appreciate quick videos that just show me how to do what I want ASAP, but on mine I like to show the why's too, so you can use the knowledge to create something else.
@bot-bot8 жыл бұрын
Thank you Rodrigo! This helped me very much. Another great tutorial with all the explanations. Not sure which version of Unreal you are using, but in 4.13.2 there is a small difference on how the material is being assigned to the PostProcessVolume. It is under Details -> Post Process Volume -> Blendables in case someone is on the 4.13. The rest is the same. Keep up the good work mate :)
@RVillani8 жыл бұрын
Thanks a lot, Bojan! I'm using 4.15
@MortMort Жыл бұрын
When i change the UV cordinends of the Custom Depth and add them togeter It dosn't mask it out, but if I dont offset the Scene texture custom depth texture it dose mask it out, why dose it not work as soon as I offset the UV's and add them togeter?
@RVillani Жыл бұрын
Maybe the offset values are miscalculated somehow? Could be many things. I advice you preview each node in your sequence of nodes to see if they display expected results. If you need to see specific numbers, you can use the debug nodes and preview them (Debug Scalar, Debug Float2 and so on). That way you debug where things are going wrong in the logic and find what needs fixing.
@Sabselol7 жыл бұрын
You Mister Villani, are my personal hero of the day!
@RVillani7 жыл бұрын
Sabselol Wow! Thanks a bunch! =D
@Zarrey6 жыл бұрын
this was the only outline tutorial that i got to work. it even worked the first time. thanks a lot!
@RVillani6 жыл бұрын
That's great, man! Happy to help
@AlexM-xr4rc7 жыл бұрын
Hey thanks for the help! The material I followed in the video didn't exactly work for my situation (because I'm working on a 2D game) but I'm able to replicate this method to an existing highlight material I have that works. Really great tutorial! Very thorough.
Жыл бұрын
Thanks man. It couldn't be more descriptive.
@Darth_Gamers6 жыл бұрын
For anyone on 4.21 getting not just an outline but a fill too, I have a fix for that. After the step at 39:02 ish, replace the Lerp with an “If” node. Plug the old Alpha in the “A” slot, set “B” to 1 using the details menu, plug the color in the “A>B” slot, and plug the Post Process Mask in the “A
@kamui67805 жыл бұрын
What a good guy ^
@RVillani5 жыл бұрын
No. If is bad for performance. For anyone with that problem, use "Start Previewing Node" on each node of the process to find where the mistake is. A "fix" will only create more operations on top of something wrong.
@Righteous_Destiny5 жыл бұрын
@@RVillani I was wonder if you knew about an issue that I'm having. The issue is even my character is 30 meters away he has a very thin outline when not occluded. Do you happen to know a fix for that? I'm in 4.21. Thank you
@RVillani5 жыл бұрын
@@Righteous_Destiny doesn't sound familiar. Is the character too thin or small? Can you share a screenshot?
@Righteous_Destiny5 жыл бұрын
@@RVillani Thank you so much for the reply! I figured out the ossue it was the temporal AA that was causing the issue
@GrayveRoseMusic7 жыл бұрын
Good work, very well spoken, even if in a language that isn't your first, because that didnt stop me from understanding. Really wanted a stylistic approach to letting Players with certain roles see all other Characters through walls with an outline, and have each Character a different unique color that matches them. This was perfect for that, thank you gent + scholar.
@RVillani7 жыл бұрын
Thanks a lot!! I'm happy to help the Unreal community! :D
@zimavi2 жыл бұрын
How to fill inner part of object with same colour with transparency?
@Randenie2 жыл бұрын
Thank you so much for this tutorial. It has everything I needed for the project I'm working on. Thank you, thank you, thank you!
@hasanshafy_3 жыл бұрын
Where can I learn more about outline detection theory? How the renderer caculates the pixel depth and such.
@RVillani3 жыл бұрын
That's an excellent question. I've never thought about it that way. I just found a bunch of tutorials with different techniques that helped me decide what worked best for me with the tool I have (Unreal, in this case). When you read about different ways to do the same thing, I think the theory comes as a consequence, because you start to realize what works better for certain situations, why it is so and with that knowledge you can even start creating your own way of doing it. That all said, I guess you could read about image processing with kernels to understand a bit more about this kind of effect. Sharpening is a similar technique to edge detection.
@hugogomezcervantes71027 жыл бұрын
Man You make PP and outlines so easy to understand! thank you very much. Subscribed :D hope to see more tutorials!
@RVillani7 жыл бұрын
Hugo Gómez Cervantes Thanks a lot! I'm currently working a lot and there's not much free time, but I'll get back to them some day. I do miss doing it.
@ColdfireAC7 жыл бұрын
Thank you for this excellent tutorial! So well explained. Please do more tut's like this
@RVillani7 жыл бұрын
Glad to help! :D I will start making them again. Just gotta complete some stuff before (work and a Broly model in Unreal)
@hiro44762 жыл бұрын
Easy to understand tut! @29:14, the lilo outline. Is there a way to exclude terrain/ground from the calculation?
@RVillani2 жыл бұрын
Thanks! Good question. The floor has to render into the depth buffer, otherwise it'd be a translucent material, wasting performance by rendering everything behind it. So it should be there in the Scene Depth. That said, you might be able to mask out lines on top of it by rendering the floor mesh(es) with a custom depth stencil. Then you could test in the post process material if the scene pixel also has that stencil value, and if so, don't display an outline there.
@zackcanoe6 жыл бұрын
非常感谢,你的教程帮我了一个大忙!thank you very much, your tutorial helped me solve a big problem!
@nick9137 Жыл бұрын
If anybody wants to be able to selectively occlude (for example lets say you have a pickup coin and your character, you don't want the outline on your character when behind the coin) you can do the following: do everything in the video except ALSO add an IF node, and we will use a stencil value of 2 as an object we don't want to occlude, (our coin will be 2, our character will be 1), you can do an if and if the stencil value is = 2 then instead of rendering out whats in the video you want to render out just the post processing input with mask of RGB, hope this helps
@RVillani Жыл бұрын
If you were asking how to do that, that's pretty much what I'd have suggested. A stencil value for "ignore this". I don't think there's another way if you can't tell those objects apart. Thanks for that comment!
@DevinDTV7 жыл бұрын
Ok I spent some hours being frustrated trying to get outlines to not x-ray, but finally got it working thanks to your video. Then I learned a way to make outlines even appear above other objects that also have outlines. I think a lot of people want to know how to do this. It's very easy to implement. You can even have objects have outlines above other parts of themselves (like the near side rim of a bowl having an outline). i.imgur.com/O1xwUO8.png i.imgur.com/SGJ0WHE.png i.imgur.com/t6jNAjh.png Hopefully those screenshots explain what you do well enough. Basically at every point where you'd normally be adding the texel depths together as in this video, instead you subtract the pixel's depth by the texel depths. Then you add those subtraction results together. Divide by a new scalar parameter which will let you adjust how aggressively it outlines things, and then finally subtract by 1 instead of 10 million. Clamp and ceiling as normal and the rest of the steps are the same. Hopefully someone else found this as useful as I did.
@DevinDTV7 жыл бұрын
Oh also in the screenshot you'll see that further objects have thinner outlines than nearer ones. This was easy to accomplish. Not only that, but I have it adjust for your screen resolution as well. i.imgur.com/loG4CLJ.png This should explain it.
@RVillani7 жыл бұрын
Very good, man! :D
@stasismedia7 жыл бұрын
Thanks for your input. I've managed to implement the overlapping outlines based on your screenshots.
@DevinDTV7 жыл бұрын
np, glad I could help
@siba28935 жыл бұрын
Thank you this was really helpful, do you know how to avoid the x-ray on the outlines when other objects are occluding them?
@Stefan-xt5sk7 жыл бұрын
This seems very useful, so I've subscribed to remember you when I might need this. :) Also I've coincidentally found comments of a fellow student on this video who has watched this just one day ago. (Arlen der Dichter) :D
@RVillani7 жыл бұрын
Cr4zy Dude cool! It's a small world indeed! :D
@LauriKalliola9 ай бұрын
Thank you for the awesome tutorial and in-depth teaching! I have a question on using a similar material: In the editor viewport view the occlusion outlines are drawn as intended, which is only when an object is behind something, for example a wall. But in the play mode and camera view the outlines are drawn on meshes even when there is nothing between the camera and for example the player mesh. Any ideas on how to fix this or what settings to look at? Thank you!
@LauriKalliola9 ай бұрын
Hmm, the problem was fixed when I swapped from using the normal "Camera" component to using "CineCamera" component. The normal camera probably has some rendering/post process settings which caused my issues.
@__foo__3 жыл бұрын
28:46 / The part of showing the visible lines only in the hidden parts of the object did not work, they are still visible in the visible and hidden part, but in the visible part the lines were blinking frequently. UE4.24.3
@__foo__3 жыл бұрын
I managed to fix it by changing the following project option: Project Settings> Engine> Rendering> Postprocessing> Activate the option: "Custom Depth with TemporalAA Jitter"
@RVillani3 жыл бұрын
@@__foo__ by activating it? Not deactivating? Usually that settings is what causes people problems XD
@__foo__3 жыл бұрын
@@RVillani activating
@Shrublandsprite7 жыл бұрын
This is so awesome! You saved me from pulling my hair out over this! :D
@RVillani7 жыл бұрын
Arlen der Dichter I'm very happy to help! ^_^
@Shrublandsprite7 жыл бұрын
I really appreciate it! I have another question though. Everything works fine now, but I would also like to add a colored silhouette to the outlines, as to basically fill them with a different color tone. In the video you are at one point seperating the inner shape from the outline, so I tried to use that to create my desired effect, but I couldn't figure out how to do it. Maybe you could give me a hint on how to do it? :)
@RVillani7 жыл бұрын
Arlen der Dichter you mean to tint the object itself? There's a part where you detect what's inside and what's outside the object, so you'd use the inside as an alpha to lerp the final color with the tint you want. I can't really see it in detail right now (traveling), but if it's not clear, tell me and I'll try to explain better when possible.
@Shrublandsprite7 жыл бұрын
The Lerp already helps, but somehow I cant manage to get the desired effect. I have been able to get outlines and fill my character, but then the rest of the world had a tint as wenn. Also I could no longer use the two color system you set up in the video. A more detailed explanation would be greatly appreciated, but don't stress yourself. if you dont have the time :)
@RVillani7 жыл бұрын
Well, approx. by 23:00 I showed how to get only the objects as white. So you can multiply this result by your Lerp tint alpha in order to tint only the objects.
@rickfuzzy Жыл бұрын
This was great. Thank you. Learned a lot
@flatinumfox2 жыл бұрын
Great tutorial. I was looking at ue5 and ScreenPosition now has a ViewportUV / PixelPosition options. I'm curious how those work.
@irenenaya76442 жыл бұрын
Not sure how they work, just want to point out that the one we're meant to use here is the ViewportUV one
@piingy4899 ай бұрын
This tutorial is great! You explain so well!! I have a question regarding the time stamp 29:12 - how can I do so that I it will only render the lines on the objects that are not behind any other scene object?
@piingy4899 ай бұрын
I finally got my nodes right, so what i did was: Custom depth - Scene Depth, then put that into ceil and then clamp bethween 0 to 1. Then I masked R and then did a "oneminus". This then got put into the multiply node that was put into the lerp alpha :)
@RVillani9 ай бұрын
Nice one! Sorry I didn't answer before. I think I missed the comment notification :( There were some people who asked something similar, I think. But KZbin's comment ordering is weird, so it's a bit hard to find it. Thank you for the compliment on your first comment as well! 🫶🏻
@twinsplayknight3 жыл бұрын
hey, This tutorial was very helpful to me, but im noticing that the lines are drawing within the object rather than outside of the object. Its important for me that the lines go around the outside of the object instead of within it, do you know how i could do this?
@MrJayden11162 жыл бұрын
did you find a solution to this?
@ZioYuri788 жыл бұрын
Great tutorial, thanks for the theory part, it's really well explained and i learned a lot about shader!
@RVillani8 жыл бұрын
Thanks for the feedback, Zio! :D I'm glad it helps!
@michtrns33962 жыл бұрын
So great job! i love it! :D - What if i want a Range in this? you know, when a camera need to been close to see it?
@michtrns33962 жыл бұрын
nvm. i found a way to make it :)
@LJ_Dev2 жыл бұрын
Great tut. Thank you very much! . Is there a way to hide the outlines for certain objects? Like for example, my character goes into shallow water and his legs are hightlighted by the outlines. How can I ignore that water on this shader? Thanks!
@RVillani2 жыл бұрын
I'm not sure about that because water is a translucent shader, usually. I think you'd have to enable depth writes for it on the water material settings and then have the water mesh render to the same custom stencil channel as the character. Or a different channel that you account for in the post process and use it to hide the outlines.
@davidewing28256 жыл бұрын
I love this tutorial, it is amazing! I'm trying to figure out how to make this effect a character ability, so I can turn it on and off in game.
@RVillani5 жыл бұрын
You could have a Lerp in the material in which 1 uses the effect and 0 doesn't. The Lerp alpha would be controlled by a Material Parameter Collection parameter. Than you could set that parameter's value from Blueprints.
@AndrewSearaCanada2 жыл бұрын
Hi! Thank you so much for the video! It helped me a lot. Can I Ask you if you think it would be possible to apply in the material something that activates the outline only when the camera/player is close (at x distance)? Or because it's a post-process material it wouldn't be possible? Thanks eitherway :)
@RVillani2 жыл бұрын
Thank you! You're in luck! Because this technique only generates inlines (so contours only on top of the outlined meshes) you can get those meshes distances from the camera (custom depth map) and subtract it from your desired max distance. The result will be negative for meshes further away and positive for the ones closer. Than you can use Saturate on that result to clamp between 0 and 1 and use it as a mask (lerp or multiply) for the outlines.
@AndrewSearaCanada2 жыл бұрын
@@RVillani Thank you soo much 😃☺☺
@1_Man_Media5 жыл бұрын
other than the fact mine is a fill not an outline this tutorial was great explained a lot of material stuff for me.. In the newer ue4 with 2 outpots for screen position uv seemed to do nothing pixel works but I have a fill is there something I can do with the uv or something to change it to an outline? I kinda dig the fill if I get an outline working I will prob make a toggle for the fill as well :)
@MrNecaKralj3 жыл бұрын
You ever found a solution for this?
@pitblastbeat3 жыл бұрын
Finally I found that efficient one! Great!
@RVillani3 жыл бұрын
Haha awesome!
@michael64225 жыл бұрын
Man you're awesome , savior to us all .
@kanoeyes6 жыл бұрын
The best tutorial about outlines! Thank you!!!
@dreaghy6 жыл бұрын
Hello ! In UE4 4.20.3 the outline does work but within a weird part ! I followed each step and your material is the same as mine ! If I can describe more, the outline appears to fill up the entire outlined object,but I wanted just an outline !
@dreaghy6 жыл бұрын
Oops my bad, the "Screen Position" node have now 2 outputs, and I did plug it in the second one rather than the first one ! The first one worked finally ! Sorry for the inconvenience !
@zacd12976 жыл бұрын
Thanks for posting this, it really helped save me some time! To anyone else who reads this, for clarification, you want to use "ViewportUV" NOT "PixelPosition".
@Darth_Gamers6 жыл бұрын
Im on 4.21 and I’m getting the same thing, but all of my nodes are correct. When he shows the different previews of what should happen, my results are all the same except for the step at 24:43.
@Darth_Gamers6 жыл бұрын
I figured out a way to fix it. I have a comment that’s not a reply to you, you can find how there
@pixelazedd3 жыл бұрын
at 14:55 where do you pull it out of that zero? doesn't work btw
Hey man, thanks for this tutorial. I finally managed to not render outlines for hidden objects. I do have another question tho. In the end of your video, at about 39:25 you're talking about rendering the outlines for overlapping objects with custom depth on. Could you please explain to me how i should do this? I've been trying for a while now, but none of my efforts work. Working with materials is different from other programming logic to me, and i just can't fully wrap my head around it.
@RVillani6 жыл бұрын
The logic you use to detect the outlines between custom depth and non-custom depth objects, you'll have to use it to detect outlines between different custom depth values
@joseruiz17636 жыл бұрын
I've been trying to do this for a while but I think I'm still not undertanding how this works well enough to do it. From what I understood, you get the outline between custom depth and non-custom depth because the addition of the 8 texels around the one we're on gets very high if even a single one is in a non-custom depth area. I assume that if you're comparing two objects with custom depth enabled the difference between the numbers is going to be much smaller, but I'm not sure of how much. How do I figure out what is the number I should subtract to the final addition for this to work?
@nawakman3 жыл бұрын
20:23 , actually since calculations are based on 8 samples pixels, this distance should be the meters multiplied by 80 instead of 100, because in your case there is 25% more lenght before the mask disappear. Anyway very good tutorial and well explained
@RVillani3 жыл бұрын
I was just adding values there, so if the 8 samples are from 1/8 of the background distance (the 100km), it adds up to background distance. So I guess we're both incorrect XD The right thing to do would be to get max from all samples. Because the real intention was just to find if background is among the sampled pixels. That would really make sure it works up to 100km, not just 1/8 of it. I should've realized it back then. Thanks for calling it out and making me think again about it :D
@nawakman3 жыл бұрын
@@RVillani To be fair this kind of calculations blow my mind, All yesterday I was trying to understand how it worked even though you given clear explication. Trying to think per pixel is so un natural to me
@RVillani3 жыл бұрын
@@nawakman IKR! the way we have to think when making shaders is pretty unique
@SilverEye912 жыл бұрын
Hi! Is there a way to modify this calculation to render not just the outline but the entire object? I'm trying to find a way to render the silhouettes of different objects as different colors but I'm having some trouble getting it to work. This is a great tutorial but I need some extra help to get that final step to the result I want :D
@irenenaya76442 жыл бұрын
If you only want to render the entire object in a different colour, you don't really need any calculations. You just use the subtraction between custom depth and scene depth, use OneMinus to invert it, and use that result as the alpha of a Lerp between the SceneTexture (the PostProcessing0 one) and any colour you choose. You can look at this tutorial from the UE people here: kzbin.info/www/bejne/gHmTaK1vdtVkns0 If you actually need both the outline and the entire object (like at different times you want one or the other), i would try playing with the line thickness parameter. Since the outline always grows inwards, there's got to be a value at which the whole object is 'painted' 🙂
@unrealkitty7 жыл бұрын
although my english is not good. but your expression is very clear. thank you for your excellent tutorial. expect more.
@RVillani7 жыл бұрын
Thanks! I'm kinda busy these last months (need money to make tutorials xD), but I'll try to get back to making tutorials as soon as I can.
@unrealkitty7 жыл бұрын
of course, earning money is top priority. but your tutorial is also valueable. I learn much knowledge about why to do something, not just how to do.
@RVillani7 жыл бұрын
Thanks! Yeah. I don't like those tuts where they just say what buttons to press. You gotta know why you're doing stuff.
@unrealkitty7 жыл бұрын
yes, we all want to know what happen behind the back of node. just like what you painted about background knowledge of outline in the tutorial.
@kostet19776 жыл бұрын
That`s very nice stuff man! Extremely useful for me. The only thing i`d like to ask is how to use it together with original material of outlined object.
@RVillani6 жыл бұрын
Thanks! It doesn't affect the mesh material. You just need to activate custom depth on the mesh, but its materials remain untouched. So the original material will still be there.
@kostet19776 жыл бұрын
ok, thanks a lot, i have to try to reproduce all your actions first. Maybe later will have some more questions.
@breikdans16465 жыл бұрын
Awesome Video!! I learnt a lot!! Muchas gracias por tu explicacion Rodrigo!!
@RVillani5 жыл бұрын
Gracias, Alberto!
@hereticbyte2 жыл бұрын
is there any method to some specific actor "not block mask"? im making RPG and when my character equip a Sword. the sword cause masking to player body mesh.
@RVillani2 жыл бұрын
What if you add equipped items to the effect with the character? Then instead of blocking, it glows with them.
@Jorge-vv8cy5 жыл бұрын
Awesome tutorial bro. this way i can comprehend why this works.
@prasadwadekar14993 жыл бұрын
I loved the tutorial, but could you please elaborate how to toggle it, so that it can be use as an ability.
@christopheaurelie69432 жыл бұрын
Hi Rodrigo, is it possible to keep the texture of the object instead of coloring the outline? I mean an oultline that keep the object texture
@RVillani2 жыл бұрын
Hmmmm interesting. Like, if it was a weapon you'd see black outlines? I don't think so, because the object is hidden so if you tried to sample its color, you'd get the color from what's in front of it. You'd have to fake it with a texture for each Actor, but that would look a bit weird as the texture would likely move with the screen, not the object. Do you have an example of something doing that? Maybe there's a better way I'm not thinking of because I'm picturing it wrong
@christopheaurelie69432 жыл бұрын
@@RVillani hey thank you for your answer. I'm trying to build a portal. I need : - the gun to be able to go inside the wall without being covered by the wall texture - and I was also thinking to use stencil for recursive portal (the dev of portal explained he did it with stencil). I'm burning my brain 😅
@RVillani2 жыл бұрын
@@christopheaurelie6943 I don't suppose he was talking abou the same type of stencil we see in UE. I found interesting solutions to that clipping problem here: forums.unrealengine.com/t/visible-through-walls/44042/11 My favorite is the vertex offset one: kzbin.info/www/bejne/gWLOgnqvd9aWqac The shadows problem at the end you could try to solve by not doing the vertex offset only in the shadow pass, like I show here: kzbin.info/www/bejne/g5KnmZuvp6uVqK8 (at 1:42:45)
@wecomfrom2 жыл бұрын
@@RVillani thank you very much for your answer ! 👍👍👍
@Tin_Can5 жыл бұрын
I've gone over the tutorial 3 times to try to figure out what's wrong, but this isn't working properly on 4.22.3 - in the final result, actors that are not occluded are still getting outlined, but that outline is jittering and looks glitchy - any occluded actors outlines work as they should though Edit: after reading a comment below, this issue is caused if Temporal AA is disabled, strangely enough - I originally disabled this because the occluded actors outlines were looking weird and this was a supposed fix for it, oh well, minor tradeoff for an awesome effect!
@__foo__3 жыл бұрын
I managed to fix it by changing the following project option: Project Settings> Engine> Rendering> Postprocessing> Activate the option: "Custom Depth with TemporalAA Jitter"
@Janokins2 жыл бұрын
In the material, you can also set Blendable Location to "Before Tonemapping"
@samstersos8 ай бұрын
Hey, so I followed the tutorial and it works perfectly within the viewport but for whatever reason when I press play it stops working. Do you have any ideas what could be causing that? Thanks for the great tutorial!
@RVillani8 ай бұрын
thanks! Could be many things. The objects in play mode could be having stencil or custom depth disabled, for some reason. Or your player camera is overriding post process settings and disabling the PP material. Or something attached to the camera is drawing custom depth covering all the custom depth in the scene. Or you were testing from inside a Post Process Volume that's not set to infinite bounds, but in play you're outside of it. Or in your material you set some parameter during play that disables the effect. Or even something else specific to your project that I'd never guess haha You'll have to debug. While playing in the editor viewport, you can press F8 to eject from your player into level-editing mode. Then you can select things in the viewport or in the World Outliner and inspect their details to see if the expected depth/stencil settings are set on the meshes. You can also select your pawn/character and inspect its camera to see if it's overriding any post process settings. While ejected, you can also change the viewport mode from Lit to other view modes and see if stencil and custom depth look as expected. To go back into possessing the character, press F8 again.
@alangonzalezleon65567 жыл бұрын
I have a problem instead of coloring the edges the whole mesh has the color but when I move the camera the edge are the one with the color any idea D:
@beginadobe3 жыл бұрын
Is there a way to achieve this if the highlighted objects are being occluded by other translucent/transparent objects?
@RVillani3 жыл бұрын
I don't think so. You could enable Allow Custom Depth Writes in the translucent material settings to get it to render its depth, but then you won't have the custom depth from the occluded object. It would only be possible if translucent materials rendered to the depth buffer, but if they did, they'd make things behind them not render at all.
@ruslandad3652 жыл бұрын
Great Tutorial Thanks!!!!
@spinningninja24 жыл бұрын
Love this tutorial! Running into a bit of a snag though, if anyone can help. Every step of it has worked for me until he tests out the occlusion part around 28:10. When he tests it un obstructed objects are black while others are white, but for me everything just turns white, no matter the custom depth. My blueprint looks exactly the same, but I'm wondering if its possible if I've missed any steps anywhere? My current engine is 4.23 if there was anything changed there that might be causing this
@LeoToyCraft4 жыл бұрын
From the ScreenPosition node make sure you are using the Viewport UV pin to connect to the add nodes - there are two pins in more recent engine versions compared to just one as in this video.
@MrSpronkets3 жыл бұрын
The resulting outline flickers a bit, any simple fix for this?
@RVillani3 жыл бұрын
yeah. Project Settings > Rendering > Postprocessing > disable Custom Depth with Temporal AA Jitter
@Granxdavis5 жыл бұрын
Awesome tutorial, thanks a lot. But it is possible to do the outline with translucent objects?
@RVillani4 жыл бұрын
In recent versions, I think so. There's an option in the material details to make a translucent material write to custom depth. I haven't tested it, but I suppose that's what it's for.
@sleepwalker60437 жыл бұрын
Thank you for making my life easier.
@RVillani7 жыл бұрын
Glad to help!
@adamc36072 жыл бұрын
Great tutorial!
@abeymiranda54577 жыл бұрын
Hey thanks for the in-depth explanation! I have a question, how do i add a 50% color fill inside the outline?
@RVillani7 жыл бұрын
You mean like highlighting the object? Well, it's been a while that I did this, but if I'm not mistaken there's a part that output's 1 or 0 if inside of the object. You can use that (multiplied by 0.5) as the alpha for a Lerp between the original SceneColor and your highlight color.
@Went2PlayLLC4 жыл бұрын
how to receive shadow on 100% transparent material? Something like a cutout material, where you dont see color, only shadows from other objects.
@RVillani4 жыл бұрын
I did something similar once. It wasn't perfect, but enough to fool the viewer on some situations. On a transparent material, set opacity to 100% and set it to Default Lit mode. Then, for its Emissive channel use the SceneColor node. Let me know if it's at least close to what you want.
@Went2PlayLLC4 жыл бұрын
@@RVillani ok, i have two nodes on translucency material, 1. scene color to emissive, and 2. opacity parameter 0, there is no shadow, its just clear translucence material. What happened now, is that shadow is pure transparent, like a hole. Opposite of what we are looking for.
@RVillani4 жыл бұрын
@@Went2PlayLLC But I said "set opacity to 100%", so it should be 1. Then, if the material uses default lit mode, it should get some shadows, display what's behind it (because of Scene Color) and be fully visible. The shadows might be weak though, because of the emissive. But using emissive is the closest you have to making it's brightness match what's behind it. Also, it might cast shadows, but you can turn that off in the actor. And, something I never managed to solve: it'll have motion blur. So if you move your matte object, you'll see what's behind it with motion blur.
@FLTxxdxx5 жыл бұрын
Great Work, thank you for the time put into making this
@iandejong25704 жыл бұрын
really clear explanations - thank you!
@RVillani4 жыл бұрын
I'm glad you think so! I've been teaching programming to my cousin and I always feel like I mumble too much. haha But that might be due to me not planning our classes ahead. 🤔
@D2lirium6 жыл бұрын
This is how you do a tutorial. Many Thanks!
@semaph0re Жыл бұрын
Unfortunately, this tutorial does not cover the most basic use-case: highlighting items, as the outlines have x-ray (see through walls). I spent some days fighting this behavior, trying to make it actually occlude when it is behind walls, but I cannot make it work. This material is a bit too complex for beginners (especially due to the lerp use at the end). Any pointers welcome though...
@rickfuzzy Жыл бұрын
Just do one minus on the bottom node
@rickfuzzy Жыл бұрын
But you can just use a fresnel in an overlay material if you want a simpler solution for that. This video is clearly for occlusion
@semaph0re Жыл бұрын
@@rickfuzzy I used this tutorial anyway as this almost does the outline effect exactly as in Deus Ex: Human Revolution. Most outline tutorials do not behave "this way" (google for a blogpost about Human Revolution rendering). As for "bottom node" and "do one minus" - please expand a bit more. I am a beginner, best to be specific.
@rickfuzzy Жыл бұрын
@@semaph0re @37:31 try add an oneminus node after the clamp at the bottom of the screen. the example is masking only the occluded items so adding oneminus will invert and mask only the non-occluded items. hope it helps.
@markarmstrong46843 жыл бұрын
No matter what I do it colors the entire object instead of just the outline. Any advice on how to fix that?
@RVillani3 жыл бұрын
output every node, on each step of the chains, to see if their output is making sense. That's how you debug materials. For numeric values, you can search for nodes called "debug". They exist for both a single scalar and float2, 3 and 4
@RVillani3 жыл бұрын
doing that you can figure out where the problem comes from by seeing its origin and reduce wasted guessing time
@markarmstrong46843 жыл бұрын
@@RVillani Thank you
@diegososa39125 жыл бұрын
Hi Rodrigo, have you ever done the tutorial about how to fix when the outlines overlap?
@diegososa39125 жыл бұрын
Can I contact you any way? I'm using outline to add people in a scene as just figures but when they pass in front of each other they overlap and it is not ok but I can not fix it.
@RVillani5 жыл бұрын
@@diegososa3912 You could contact me here: rvillani.com/bio-contact There's more than just e-mail there, but I won't post here to avoid spam. But I've been very busy. :( I have another tutorial (not in english though) that uses a technique on the stencils that displays only one color at a time. The problem with that technique is that it displays the color of the highest stencil value using Max.
@diegososa39125 жыл бұрын
@@RVillani Thank you Rodrigo, I sent you an email from the company where I work explaining better my problem.
@matty37327 жыл бұрын
Great tutorial!! but I have a question, what if I don't want the outlines for objects behind? I mean for all the static mesh but not when are behind something. I'm trying really hard but I can't find a way to do it!
@RVillani7 жыл бұрын
Thanks! Check if the custom depth value is higher than the scene depth. If it is, your custom depth mesh is behind some other scene object, because those values are the distance from the camera. An easy way to mask it out is to do: • SceneDepth - CustomDepth • Clamp (0, 1) • Plug the result into a Ceil node Now you'll have 0 if it's behind something and 1 if it's not. You can use that with a multiply or a Lerp to mask other effects.
@matty37327 жыл бұрын
ok I finally manage do it! thank you!!! (I didn't except you would have respond to my comment :D)
@RVillani7 жыл бұрын
Matty37Casa nice! I was gonna send you an email, but when I had the time. Glad you managed to do it =)
@badrequest55967 жыл бұрын
i was having the same problem but doing SceneDepth - CustomDepth was just removing the outline completely. so i tried adding a 1-x node after the clamp/ceil and it inverted the result and now the outline is only when objects are visible and not when behind something else. while im at it, can i change the size of the outline? i wanted to make it just a little bit bigger.
@OmegaMouse6 жыл бұрын
Would you please spell this out for me? I'm having the same issue with the outline showing through objects in front of it. What exactly does this modification look like and where do you plug this in at? Thanks!
@GaneshPingale7 жыл бұрын
Thank you for the detailed explanation. Worked as expected but the outlines are kind of shaking. Do you know why and how to stop it?
@RVillani7 жыл бұрын
I believe it can be Project Settings > Engine > Rendering > Postprocessing > Custom Depth with TemporalAA Jitter It's enabled by default. Try disabling it.
@GaneshPingale7 жыл бұрын
Unfortunately, still same jitter after disabling/enabling the option.
@RVillani7 жыл бұрын
What about Rendering > Default Settings > Anti-Aliasing Method If it's not that, then I really don't know. Does it shake even with the camera and objects completely still?
@Beriol97 жыл бұрын
I experienced the same thing, To fix it, open the material and go look in the parameters for the "Post Process Material" section. Inside there is an option "Blendable location": select "Before tonemapping"
@RVillani7 жыл бұрын
Good one! I didn't remember that. It'll make you post process be calculated before the anti-aliasing pass, if I'm not mistaken.
@KIR_Engineer6 жыл бұрын
Great Tutorial. I''ve got one question. Is it possible to change alpha of color to make outline some transparent?
@RVillani6 жыл бұрын
Thank you! Yes. You can lerp the final result with the original scene color. The lerp amount will be the alpha
@KIR_Engineer6 жыл бұрын
Big Thanks, Rodrigo! It works!
@DEFICITGames5 жыл бұрын
Awesome Tutorial! Thanks!
@MatheusGamedev Жыл бұрын
Would you help me? My game has several objects, I wanted to know if there is a way to limit the effect to a specific radius. Also, your tutorial is awesome!!!
@RVillani Жыл бұрын
Thank you! You could multiply the final effect mask by an additional sphere mask. Then you can set the center location and radius via parameters (perhaps from Material Parameter Collection), while passing WorldPosition as one of the inputs, which represents the location in the world of the pixel you're currently computing for.
@MatheusGamedev Жыл бұрын
@@RVillani Thanks again, worked really well!!!
@youtubi123youtubipel3 жыл бұрын
Perfeito! Me tira umas dúvidas: Primeiro, como aumentar a grossura do outline? Tem um jeito fácil? Segundo, tem como os outlines ficarem independentes pra cada objeto ao invés de se fundirem quando eles se sobrepoem?
@RVillani3 жыл бұрын
Vlw! 1. Vc chegou a assistir o vídeo? Tem literalmente um capítulo sobre isso no video. 2. Acho que sim, mas não é fácil. Vc vai precisar usar o mesmo esquema de detecção de linhas pra detectar diferenças no canal de stencil. Essas diferenças são as bordas entre os objetos.
@youtubi123youtubipel3 жыл бұрын
@@RVillani Putz, que vacilo o meu. Eu acompanhei o vídeo e reproduzi tudo aqui no meu projeto só até antes do capítulo onde vc exclui as partes visíveis. Ou seja, 1 capítulo antes de vc configurar a grossura das linhas. Foi mal. Agora quanto as bordas, infelizmente usar Stencils pra uso Não é viável aqui no meu projeto. Eu já uso os stencils para outro efeito de PostProcess e vários objetos usam o msm Stencil. Segundo que eu tenho centenas de objetos na cena, vários colados um no outro. Usar 1 Stencil diferente pra cada um seria impraticável. Mas mesmo, obrigado pela ajuda! Seu vídeo ajudou demais e explicou muito bem. Seu inglês também é excelente.
@RVillani3 жыл бұрын
Putz kkkk Pior que acho que só com os stencils mesmo. Obrigado! Agora melhorou um pouco, mas obrigado!
@ianx20124 жыл бұрын
Good Tutorial!!! Is anyway to hide in some object? I want it visible behind the wall, but it also visible to the character....
@RVillani4 жыл бұрын
Thanks! I didn't understand what you're trying to do. If it's visible behind the wall, it's visible to the character. Right?
@ianx20124 жыл бұрын
@@RVillani :(( Sorry for my poor English... Easy to say, what I want just not effect on the character.
@folksgames70477 жыл бұрын
Thank you bro!! Great video
@RVillani7 жыл бұрын
Thanks! :D
@furrybproductions5 жыл бұрын
Is there anyway to make adjust the alpha of each color in the material? I'd like it so that one of them has an opacity of 0.
@RVillani5 жыл бұрын
The Lerp that mixes the effect with the scene: multiply the value that goes into the Lerp alpha by how much you want the colors to affect the scene.
@furrybproductions5 жыл бұрын
@@RVillani can you post a pic of the graph? I'm trying to use your material as a highlight material in game and need it to be visible behind walls as well as not behind walls.
@furrybproductions5 жыл бұрын
@@RVillani the reason I need one of the colors to have an opacity of zero is because I'm finding that the postprocess on the character helps occulude the highlight of objects behind them. If you have a better solution where I can have the highlight not show thru or over my character that would be best. Can you do a tutorial specifically on creating a highlight material that works in this way? It'd be a lifesaver for noobs.
@szerothH4 жыл бұрын
Thanks bro, this helps me a lot!!
@Severe_Valenok7 жыл бұрын
Hello What music track playing at the start? Great tutorial by the way!
@RVillani7 жыл бұрын
Thanks! It's Cold Killa (Sting) from the KZbin Music Library
@MrSpronkets3 жыл бұрын
Can you go over how to hide active player-related meshes without setting their custom depth to 0? Is that possible?
@RVillani3 жыл бұрын
If you mean hide from the post process, don't activate their custom depth
@MrSpronkets3 жыл бұрын
@@RVillani What I was basically meaning is to make the outlines not show when behind certain meshes, but not all. Or maybe you can better explain what you meant...
@RVillani3 жыл бұрын
@@MrSpronkets actually, I need you to clarify XD Do you want to not have outlines drawn behind the player mesh or not have the player mesh draw outlines when behind other meshes? Or something else?
@MrSpronkets3 жыл бұрын
@@RVillani If you remove custom depth render from the character's mesh, it won't hide the outlines showing through your character's mesh. If you have 2 materials showing custom depth, the material will hide the outlines of the mesh behind it, so the character mesh would need to show custom depth render. But that would also mean the character mesh would be showing outlines. Yes? I want the outlines to not show through the character's arm and I don't want the character to have an outline.
@RVillani3 жыл бұрын
@@MrSpronkets ah, I see. You'll need custom stencil, then. Besides custom depth, you can have a different value rendered to the stencil buffer for each mesh (up to 256 different values, because it's 8 bit). If you need a custom depth mesh to not occlude another custom depth one, you can use the stencil options with bitmasks. They write only the bits they're assigned to and don't overwrite other values' bits. So if you had a mesh render custom stencil 1 with bitmask 1, and another with custom stencil 2 and bitmask 2, both stencils 1 and 2 can be seen overlapping in the stencil buffer. But you need material logic to read those bits individually. I make a custom node with two inputs: StencilValue and Bit. Then its code is return (int)(StencilValue * 255) >> Bit & 1; Bit should be the zero-based bit index you want to test the stencil for. If you want to test the bit that means 2, for instance, it's the second one. So count 0, 1. 1 is the second, so you'd pass 1 as Bit. Stencil values matching your mask will return 1 and others will return 0. It requires some knowledge about binary numbers. But I can't think of other ways (at least rn) to have both the player and meshes behind it be distinguishable on the post process. This way the player will render on top of the other meshes in the custom depth and you can filter what generates outlines or not from their custom stencil values.
@HarukiGamer7 жыл бұрын
Vídeo incrível, porém infelizmente não compreendi ele completamente por não saber muito de inglês, seria ótimo se algum dia você pudesse fazer uma versão em português dele. Mas de qualquer forma esse vídeo já me ajudou, muito obrigado :D
@RVillani7 жыл бұрын
Valeu, cara! Eu fiz uma técnica um pouco mais avançada neste aqui: kzbin.info/www/bejne/n5S0inmlbcuAqLc E está em português :D
@HarukiGamer7 жыл бұрын
Ok, vou dar uma olhada, vlw :D
@qwer47907 жыл бұрын
It looks like you forget to connect a node at 17:18
@qwer47907 жыл бұрын
BTW, your way of choosing outline color based on "lerp" is a little complex, I suggest you make a custom material function using "custom" node with code, that would be way easier!
@RVillani7 жыл бұрын
You mean this 17:55? :D
@Jay66Bird7 жыл бұрын
Nice job man!
@Jukerlaw4 жыл бұрын
U just earned a sub.
@RVillani4 жыл бұрын
Thank you! ^^
@Jukerlaw4 жыл бұрын
@@RVillani Actually there's one more thing I wanna ask. What's the differences between Scene depth and Scenetexture.Scenedepth nodes? Also I feel like pixeldepth and scene depth are similar, they all do output the distance between camera and the rendered pixels right?
@cmds.learning74264 жыл бұрын
very good tutorial!thanks friend!
@RVillani4 жыл бұрын
thanks for the kind words :)
@saintkiler11874 жыл бұрын
Great tutorial. Thank you very much.
@RVillani4 жыл бұрын
Thank you!! Glad to help!
@George-pk5jw6 жыл бұрын
Nice thanks for tutorial, you are awesome!
@ayoubrezzouk30603 жыл бұрын
Guys i followed this tutorial but my outline is always mixed like if the custom stencil mask ( R) is returning a float value between 0 and 1 .....
@RVillani3 жыл бұрын
can you upload a screenshot somewhere and link it here? I didn't really understand the problem.
@limks965 жыл бұрын
Thank you for sharing ur knowlegde !
@damnation87945 жыл бұрын
Hey I did this tutorial twice just to make sure. I can not change colors. I want to use everything in this vid but several different ways. I did not realize that my game would basically be all post processing