Object Blending with Dither Fade, Pixel Depth Offset and Distance Fields
Vložit
- čas přidán 8. 09. 2024
- This week I show you how you can use Dither Fading and Pixel Depth Offset to blend solid objects together and then also how you can use Distance Fields to mask this automatically.
If you want to learn more about Materials in Unreal Engine check out my new course here:
tharlevfx.gumr...
If you have any questions about Game Art VFX or the Unreal Engine then email me: tharlevfx@gmail.com
Or you can find more tutorials on my website: www.tharlevfx.com
or check out my work on the Unreal Marketplace:
www.unrealengi...
or follow me on Twitter: @tharlevfx If you'd like to support the channel you can do so on Patreon: www.patreon.com/tharlevfx
I was about to just give up on this after a day of searching for a way to do it. Cheers!
This may not be the place to ask this question but here goes. Embergen renders out really nice depth maps for flipbook renders. Is there a way of using these to essentially "Push and Pull" pixels in screen depth buffer in UE5? Hope the question makes sense. I'm very new to UE5 (propietry engines and whatnot in the past) and your Udemy videos have been a godsend. thank you :)
What would be the result you’re hoping to get? You could certainly use the depth texture with depth fade for a nicer intersection - check my latest video from yesterday
Gods work! great stuff. I found this in the paragon assets, but i dont think it used distance fields. either way. i forget how to use it every time. this vid saved me! :)
Thank you so much. I saw this in another tutorial but you teach it so better.
Someone buy this dude a great mic! Nice video though~
Bao Richard I’ve just got one! Hopefully should be better from now on :)
@@tharlevfx I am so grateful for your videos, but at the same time watching them back now makes me want to pull the hair (out of my ears)...I couldn't understand the audio drop-outs and didn't know if it was a CZcams artefact or from your recording. Anyway, thanks for all your efforts.
Great video so far. Thank you
Nice! (but to show the effect you could use different colors, not white on white :) )
renderman.pro thanks for the idea, I’ll try and show this sort of thing off better next time!
Thanks! Amazing tut
whoa distance fields might be quite useful in refraction keeping the water line stable
Generally I used depth fade for that but distance fields would totally work too
@@tharlevfx which would be more performant do you think?
@@drekenproductions I’m not 100% sure - you would have to do some tests. Distance fields are quite cheap to access if you’re happy paying the disc space to enable it.
Probably they’re both so cheap it’s unlikely to make a big different in all honesty.
Hi tharlevfx, thank you for the tutorial!
Sooo helpful! Thank you sir!
Thank you so much, very helpfull
Thanks brother, this is the clearest guide I could find
super helpful mate. Your tutorials are the best :)!
In the end you connected it to the PDO output, but mine only works in Opacity Mask
very good!
Hey Tharle, thanks for the video. would you care to explain what the difference between the Saturate Node is and a regular Clamp?
Thanks for the question, I’ve actually just covered that in my latest video - Unreal Shader Math 102. Check that out and let me know if you have any more questions!
This is amazing, thank you so much😊
Very helpful!! =D
Best way to blend objects is simply to use the DitherTemporalAA node and put a scalar parameter of 2-5 on the Alpha Threshold and put that on PDO in the material attributes.
Hi. How to get smooth edge when i use masked material and ditter temporal AA node. This is good for optimize but i need more smoothest edge because i need smoke
in that case you would just have to use a transparent shader and pay the extra shader cost. Temporal dither AA is a nice technique for some things, but not suitable for every shader
I'm not sure if you are still doing tutorials but here is a question - imagine two meshes - Mesh A and Mesh B, which intersect. Is there a way to make the area on mesh A transparent based on where Mesh B intersects it?
Haven’t for a while but will again soon hopefully! And yeah - check out the custom depth buffer - Tom looman has a great article about it iirc. Or possibly just a world space mask depending on your use case. I made a video about them.
Well well
please, get rid of the noise gate in your mic. sometimes your voice doesn't even come forth
thanks for the feedback - i've turned it off for now but i live in a busy area so hopefully there's not too much background noise. Hopefully i can upgrade my setup soon and get a better mic!
Hi! It's all great but unfortunately it doesn't seem to work with geometry that doesn't have any volume (e.g plane or landscape). Even if the object is cube, the effect is different depending on the cube scale (if its too thin it doesnt work at all). Is there any way around it? Maybe some AO based calculation?
Could you try and use a distance field proxy mesh to add to the distance field, even if the object doesn’t have volume?
Pixel offset and dither fade should still work no?
@@tharlevfx Well, offset kinda works when its value is below 0, but what it does it changes the overall color of whole object (in this example sphere).
In general I'd like it to be universal setup, so I can't just create proxy mesh for every object I need, It would take ages in some cases :D I ended up with leaving the "Affect Distance Field Lighting" turned on and working with this noisy thing that's generated intsead of smooth gradient - it's still better than dithering all over the object :)
hi! fast forward to year 2021. Is this technique working with Raytracing? Thanks!
I’ve not tried with raytracing I’m afraid but I believe pixel depth offset should still work. There’s actually better blending techniques using runtime virtual textures - look out for a new video soon!
Do you have a fix for that banding in the z-depth?
Southern Hunter if you mean the skybox then it shouldn’t be an issue - it’s just the way large numbers are displayed
follow all the steps but my mesh is getting this awful shaddowing :( and when I turn on distance field lighting gets better (??) haha
know this is old but wish the mic would stop cutting out
Hi I'm new to UE4 and I can't seem to find a node called "Offset", could it be know as anything else?
Southern Hunter it’s probably a Scalar Parameter that I’ve named Offset. Hold S and click to create one. It’s a value you can name and edit to make your materials
@@tharlevfx thanks so much
I am profiling my game, and stuck with high translucency and lights numbers. Do you have any ideas on how to profile and identify the culprit?
Check the shader complexity view mode for where you have areas of high overdraw - and the gpu profiler should help identify which lights are expensive
@@tharlevfx Thank you for the answer!
Lights? I thought Translucency was related to materials and not the lights??
@@suitoha9336 translucency is mateirals - sorry you mentioned lights too.
@@tharlevfxOh, yeah! I decided to turn off all lights in the particle effects. And, try to add gradually while measuring.
Optimization graphics for a newbie is very overwhelming.
@@suitoha9336 if you check out the reading list on my website : tharlevfx.com there’s some links to articles about optimisation. But yeah, it can get pretty complex!
The conclusion is that we should not use this method for many objects. I was looking for a solution for rocks blending nicely with terrain - i mean thousands of them.
take a look into runtime virtual textures - they work with landscapes and are the best way to do material blending these days - i've not got a video on them yet, but check out Ben Clowards youtube channel, i think he just covered them
Can this be used with lerp to the alpha value? I've tried it, but I'm getting such a low resolution, pixelized effect :(
Particles can read from distance fields but not write to them. Generally particles are translucent or additive and you just use a depth fade to deal with blending. There’s also a new technique with Runtime Virtual Textures, I’m just putting together a video on them now.
@@tharlevfx Thank you for the detailed response!
I actually edited my question to ask about "lerp the alpha" instead of using it with particle effects. Do you have any ideas on lerping alpha with Masked blending?
I have another question that I put in another comment.
@@suitoha9336 masked will always just be on or off so you need to use translucent or dither fade to get a nice soft transition
@@tharlevfx Thank you for the reply! Is there a difference between translucent and dither fade in terms of calculation costs?
@@suitoha9336 dither fade with masked material will be much cheaper but there's a big visual difference between the two.
Loved your video but the sound was constantly getting on and off
Doesnt work for me. Sphere just stays black o.O
Hi Thanks for the useful tutorial, I tried it in UE5 but it didn't work, it had the same behavior until 10:36, but as soon as I set it to Opacity mask, the whole sphere became translucent and it was displayed on the back side. What should I do? Here is the video : czcams.com/video/3YO78BYjU_w/video.html
nvm, resolved by changing the version to 5.0.2 :)
EH UH EUH EH