How to Create Masks With the Custom Stencil Buffer | Tips & Tricks | Unreal Engine

  Рет қаралды 104,805

Unreal Engine

Unreal Engine

Күн бұрын

Пікірлер: 70
@Sedokun
@Sedokun 4 жыл бұрын
8:24 - There is one major issue with this tutorial: LERP Alpha in UE4 is not clamped. This means it can go beyond the range of [0,1]. If you feed an alpha of 2 there, it won't stop at value B, but instead will interpolate further. Which will Oversaturate the colors. Example: A = 0, B = 100, Alpha = 2 -> Output will be 200. To clamp value in [0,1] range use SATURATE node.
@PsyCoCinematics
@PsyCoCinematics 2 жыл бұрын
Very nice! Read your comment before finishing the vid, just duplicated a spare box and saw the color change as soon as I upped the stencil depth number. Tweaked it as ya said, boom! Perfect!
@DavidAllenFarrell
@DavidAllenFarrell 6 ай бұрын
You were born to do this kind of work. Thank you.
@alienrenders
@alienrenders Жыл бұрын
To make this obey depth buffer, add two more scene texture nodes. Select SceneDepth and CustomDepth. On each, add a Mask node (leave R checked, uncheck the rest). Link CustomDepth (mask) to the top of subtract node. Link SceneDepth (mask) to the bottom. Use a Saturate node on the result of subtract. Then feed that into a 1-x node. Then multiply this to what you're using for the alpha of your last LERP node and use the result as your new alpha. Make sure your actor has the checkbox enabled to write to the Custom Depth buffer.
@bigolbearthejammydodger6527
@bigolbearthejammydodger6527 3 ай бұрын
you are a bloody life saver mate. absolute legend! I'm an indi dev and you just made our 'with thanks' to section with this. I knew it was the depth buffer causing the problem but honestly was not sure how to fix, you saved me a day or so research.
@shivandrews1055
@shivandrews1055 2 ай бұрын
Thank you! this works a charm - though the only thing I've run into after implementing this, is the Skylight object in my scene is no longer affected by my PPV. I have the PPV set to infinite bounds as well... Any ideas?
@alienrenders
@alienrenders 2 ай бұрын
@@shivandrews1055 Does your skylight use the custom depth buffer? I've seen water assets do this. If so, you can't have two uses for the same buffer. Some water assets let you disable the use of custom buffer. Other than that, not sure why a light would be affected.
@thepixeldump
@thepixeldump 18 күн бұрын
Champ comment!
@csking9929
@csking9929 4 жыл бұрын
This really helps!! Finally, there is a tutorial with clear explanation about post processing!!
@stefanguiton
@stefanguiton 4 жыл бұрын
Super useful! Ive been looking at how to do this for ages, this is quite a simple approach.
@lpnp9477
@lpnp9477 3 жыл бұрын
Finally, I've been searching for an answer to this question since literally 2015. THANK YOU!
@blueneongraphics
@blueneongraphics 2 жыл бұрын
one of the best and to the point tutorials/examples. thank you for the reference content. have had to come back to this video several times
@bobbyr
@bobbyr 4 жыл бұрын
Keep making these shorter and consice tutorials, we don't need the drawn out intros and podcast style tutorials are way too long.
@HandheldGamingHQ
@HandheldGamingHQ 3 жыл бұрын
this ^
@suitoha9336
@suitoha9336 3 жыл бұрын
Totally agree!!!!
@rickfuzzy
@rickfuzzy Жыл бұрын
100%
@digitaltrash
@digitaltrash 4 жыл бұрын
we need more video like this
@jakelofgren2510
@jakelofgren2510 4 жыл бұрын
So the full color on certain objects is working... but whenever that object is placed behind something, whatever is in front of it gets full color based on the shape behind it. how do you fix this??
@Jambax
@Jambax 4 жыл бұрын
To make it more useful, the Custom Stencil really needs to be made available for Opaque materials in the pixel shader. It's already possible with engine modifications, but it's a nasty hack to do so.
@stormolflak
@stormolflak Жыл бұрын
Thank you! It took some time to figure some stuff out muself, but this is really helpful!
@Rolangee
@Rolangee 6 ай бұрын
This is amazing explanation !!!!!
@NahitoKun
@NahitoKun Ай бұрын
change your anti-aliasing to FXAA or MSAA in project settings > Rendering to remove jitters.
@allashama
@allashama 3 жыл бұрын
God damn! Texturing is a mindblowing brain! You have to be alien to understand it lol.
@3datonement687
@3datonement687 Жыл бұрын
Great Explanation, Thanks A lot
@joepolidoro429
@joepolidoro429 2 жыл бұрын
Any thoughts on being able to identify if an actor is currently showing its custom buffer/stencil? I'm looking to trigger events only when an object displays its stencil.
@나랑드-i3y
@나랑드-i3y 3 жыл бұрын
I can understand so easily! thanks to this video
@haiyimei
@haiyimei 3 жыл бұрын
dude, amazing tutorial! thx a lot!
@ty1978
@ty1978 10 ай бұрын
How would you go about using this method on decals? My scene is black and white using a desaturate in the PP Mat but I need for the decal (blood etc) to still be red when I shine my flashlight on them. I set up a Decal BP to test but the decal has no custom depth, any ideas? Thank you!
@evecsb
@evecsb Жыл бұрын
Hey thanks! You saved my life!
@milagro2300
@milagro2300 3 жыл бұрын
That´s what I call "TEACHING"! Thanks!
@DemonsWizards
@DemonsWizards 4 жыл бұрын
6:57 🖤 from DEMONS WIZARDS
@HyperCazual
@HyperCazual 4 жыл бұрын
I think I can speak for most of us saying... we've heard enough about "making your own masks". Can we give it a rest already? Oh wait, what?
@skydrowdev
@skydrowdev 4 жыл бұрын
Lol I had a hard time getting it 😭😂
@samohickey
@samohickey 3 жыл бұрын
I am trying to use this technique on my ocean, so that it doesn't have a comic outline like the rest of my game.. I'm soooo close... but having an issue on where to hook it up on my material. Must... Study... More... Materials! :D
@tacticalteamkilling6539
@tacticalteamkilling6539 2 жыл бұрын
Is there a way this can be applied to lights? For example, an IR light/laser
@giovannisolimeno5040
@giovannisolimeno5040 3 жыл бұрын
This was really useful, thank you
@nonpurplestar4158
@nonpurplestar4158 Жыл бұрын
Greetings_!! Thank you for the helpful tutorial_!! I have sprites instead of regular objects on my stage. These sprites are markers that I can colorize. The problem is that the color of the material is not accurate due to the lighting in the scene. In the editor, I can turn off the light by applying the unlit mode, but after building the project, this mode is not available! I know that this effect can be repeated by inserting into (post-process material) your post-process material with a diffuse map. After this action, my sprites on the stage become transparent, how can I avoid this or am I doing something wrong_?! Thank you in advance_!!
@KostasOreopoulos
@KostasOreopoulos 3 жыл бұрын
What a great tutorial
@samgielen
@samgielen 3 жыл бұрын
How could I render that mask as an alpha channel instead of a color? I want to use this technique to create an occlusion object in Virtual Production, which is running realtime, so Luma Matte usage isn't possible, I really need the mask to render as an alpha channel. How would I go about creating that?
@nitrork
@nitrork 2 жыл бұрын
Thanks for the tutorial, this is approaching pretty close what I need to accomplish, but I'm wondering if there is a way to create stencil passes PER track/element- or individual meshes of an object? I'm working with alembic geometry caches of character animation and would like to be able to isolate certain parts of a render (like the eyes for example) independent from the rest of the object. Is there a way to do this without having to import every single character element separately? Ideally it would be great if you could assign custom stencils according shader Id's.
@dysnXO
@dysnXO 3 жыл бұрын
anyone know if its possible to enable and use Custom Stencil pass on Decals? it works with meshes but it seems not to work with decals
@oxygen9828
@oxygen9828 3 ай бұрын
no way there's anything you don't know about unreal. Really like your works, I am often motivated to keep going by them. GL!
@Armetron
@Armetron 3 жыл бұрын
Lets say I want to render an object that is behind a wall infront of a wall as if the wall wasn't there, how could I do that?
@android0552
@android0552 5 ай бұрын
how to hide actors with post process and custom stencil?
@RealDaveTheFreak
@RealDaveTheFreak 2 жыл бұрын
Awesome feature for the most part. But it doesn't seem to work with sprites. :(
@rendermanpro
@rendermanpro 4 жыл бұрын
Make "add AOV channel", or custom buffer, and it will simplify everything.... instead of that duct taping style. *Make simple things simple.*
@liepins444
@liepins444 4 жыл бұрын
This would make it a universal change to the object, where the current implementation is selective use. In this example, it's to a specific post process material. Keeping things modular enables more use case scenarios at the cost of ease of use. Epic is pretty good about not over simplifying features that would put them in a small box. Edit:spelling
@liepins444
@liepins444 4 жыл бұрын
That said, tools to create "render layers" would be fantastic! These overrides would be specific to rendering and would not be expected to function properly in realtime.
@kinggore5229
@kinggore5229 4 жыл бұрын
Good stuff.
@mediaguy9557
@mediaguy9557 3 жыл бұрын
Thanks, but my head hurts trying to comprehend the later part of the videos...
@goldennboy1989
@goldennboy1989 3 жыл бұрын
How do I prevent the mask from being visible even if the masked object is occluded by something else?
@joelwynd9233
@joelwynd9233 2 жыл бұрын
did you find a solution ?
@Urammar
@Urammar 2 жыл бұрын
@@joelwynd9233 Did you? Lmao
@joelwynd9233
@joelwynd9233 2 жыл бұрын
@@Urammar you need to assign a stencil mask to everything else in the scene as well. Object being masked = stencil 001. Everything else in the scene = stencil 002 . This worked for me
@Urammar
@Urammar 2 жыл бұрын
@@joelwynd9233 thank you, but I've actually found a more robust solution! Compare the stencil with a custom depth/scene depth comparison. It's probably not as performant though, but it catches all the edge cases
@CYPHERNATURE
@CYPHERNATURE 2 жыл бұрын
Is there a way to do it inverted, where the post processing only affects the object, and not the reset of the environment?
@fattumhawk
@fattumhawk 2 жыл бұрын
what do you mean? just affect the result of the stencil buffer to modify the affected range, you are supposed to do it in material
@Kaboom1212Gaming
@Kaboom1212Gaming Жыл бұрын
This is an old comment, but the way you can isolate your object is by putting a 1- node before the multiply in the shader, it'll invert the mask in there. If that's what you mean.
@yang_daxia
@yang_daxia 2 жыл бұрын
Why the objects have no jitter? I've been working this for two weeks...
@yang_daxia
@yang_daxia 2 жыл бұрын
Could I get the resource in this case?
@edwinluthfisaputra107
@edwinluthfisaputra107 2 жыл бұрын
Try changing the processing in your post process mat setting to be before/after tonemap
@johnvpaite
@johnvpaite 4 жыл бұрын
Whats the difference between this and using the default channel system when we are rendering out custom passes? Does this take into account the depth of field?
@Mw_kwak
@Mw_kwak 2 жыл бұрын
Hmm, this doesn't seem to be working on Blueprint object. Well not in UE5. Haven't tried older versions
@dissonantprotean5495
@dissonantprotean5495 2 жыл бұрын
this works fine for objects inside blueprints in UE5. Are you trying to put the post process volume in a blueprint? Because you can't do that.
@offbeatlegend2171
@offbeatlegend2171 4 жыл бұрын
wow
@joshryan2382
@joshryan2382 4 жыл бұрын
Can you do a live stream or a video explaining ai with Fortnite henchman or bots
@logandoejogando...7532
@logandoejogando...7532 4 жыл бұрын
WHAT 100% OFF MEANS IN THE UNREAL ENGINE STORE
@user-yo4jd6bt1y
@user-yo4jd6bt1y 4 жыл бұрын
Pes2022
@GabrielePardi
@GabrielePardi 9 ай бұрын
Great tutorial: to the point! Thanks
Unreal Engine Materials in 6 Levels of Complexity
44:12
pwnisher
Рет қаралды 292 М.
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 192 МЛН
Happy birthday to you by Secret Vlog
00:12
Secret Vlog
Рет қаралды 6 МЛН
How Strong is Tin Foil? 💪
00:25
Brianna
Рет қаралды 70 МЛН
Unreal Engine 4 Tutorial - Custom Depth
14:02
Ryan Laley
Рет қаралды 35 М.
Why You Should Be Using Stencil / Render Layers - Unreal Engine 4.26
16:58
Real-Time Path Tracing in Unreal Engine 5 | Unreal Fest 2024
36:26
Unreal Engine
Рет қаралды 141 М.
Unreal Tutorial - Black and White Shader with Excluded Objects
8:45
The Game Dev Channel
Рет қаралды 18 М.
Learn About Post-Process Effects in Unreal Engine | Webinar
35:48
Unreal Engine
Рет қаралды 123 М.
Asset Variation With RGB Masks | Unreal Engine 5.2 | Full Breakdown
37:34
Stylized lines and outlines - Unreal Material
46:47
Kamil Hepner
Рет қаралды 59 М.
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 192 МЛН