UE5 Camera Occlusion Masking - Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys today let's create a camera occlusion masking effect in a engine in top down template we will use a very simple way and we don't even need to change the materials of MH in the level of course we can use this effect in thir person template here we have two mhes can be blocked when we move behind this mesh we can see mesh is fading okay first let's create a camera occlusion masking effect in top down template project settings C we add a new TR Channel rame it to wall and the default response is ignore in the level we first create some MH that need to use this effect in order to easily find this MCH we can create material of course in actual use we don't need it because we achieve this effect by setting MH visibility just set a black material give each MH you want to use this effect a black material and select them in details search C we need a custom and wall is block okay the black mes can use this effect Other M will not then in Charter blueprint we need a un tick and spere Trace by Channel okay start location is our camera location yes it's here and the location is our MCH location okay get camera or location also Mash or the location here we need to add a say access of 90 to8 because it's default location is root we need to change it to pway okay sphere radius set it to 30 Trace channel is wall we just created and draw theb TP is for duration now let's check it in the level okay we can see the sphere trees can hit the black MH yeah it's green when we move out we can see the sphere trees is right the that means no heat we need heat the Char so in capsule component collection channel of wall is block okay let's check it in the level oh we forgot unable to ignore self okay we can hit the chter then we need break C the result add all H component to an array and promote to variable rename it to wall now we can Branch the Heat result if heat component equal to our Charter that means there is no need for occlusion masking if it component not equal Charter that means there is a MCH that needs to be masked between the camera and Charter so we add heat component to wall array and for each Loop the array okay we need another Branch if current array alignment equals hit component that means the MCH is current between the camera and the charter so we can set it visibility to Invisible if they are not equal that means the MH is not between the camera and the Char so we can set it visibility to visible and remove the item from array okay let's check it in the level yeah it's invisible okay if we move out we can see oh yes we forgot set the result if current heat component is our Charter it's same with for each Loop array and the set is invisible because there is no match between the camera and the Char finally clear the array now let's check the effect in the level okay it's work this is really simple we don't need to set materials or other things just need a sphere TR Channel now let's create this effect insert person template here we can use material to make the uion masking effect better first change blend mode to mask and also create a parameter R name it to mask then we need a desert temple use this material function we can create a translucent effect in The Mask blend mode okay go back to third person Charter blueprint we first need to copy notes in top down blueprint they are the same here camera is follow camera also when you need the wall array and the capsule component the Collis yeah wall is block okay we don't need to set visibility here we need to use materials to control this effect so let's get material and create Dynamic material instance here and set scalar parameter value the value is one yeah it's visible then copy this noes and connect them if it's true the value is zero also parameter name is mask copy this not again the value is is zero same way yes okay let's check it in the level okay we place some MH can use this effect and their collection wall is block also we need to change their material now if our CH to move behind the AL oh yes the camera collection we need to set the camera is over life okay we can say is invisible if our Char behind them then in material we need a fade effect add a screen position mask our Channel and subtract 0.5 take absolute value and and multiply by two now we get a one to0 to one gradient this is the same way I text card the UI okay save the material and let's check it in the level yeah we can see the fade effect this is great okay that's all for this video hope you enjoyed bye
Info
Channel: Alex Huang
Views: 1,724
Rating: undefined out of 5
Keywords:
Id: tVkERb8lpcw
Channel Id: undefined
Length: 8min 29sec (509 seconds)
Published: Tue Nov 28 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.