World Aligned Blend + Displacement


I was trying to figure out a way to texture the crest of my ocean waves that are made with a displacement calculation depending on the angle or the height, the World Aligned Blend doesn’t seem to work with displacement, is anyone aware of a similar technique to texture displacement based on angle/height?


I got the World Aligned Blend to work by sending my displacement in the In World Vector, the result is not mind blowing but this is what i’m going to use if there is no better solutions

I have a basic height based approach for you, it might not be everything you need (wasn’t for me, at least not yet, still experimenting) but maybe you can get it to work better. On the lerp, plug your base color into A (blue), and your foam into B (white). See attachment #1.

To get foam to appear around a shoreline or around objects in the water like in your storm scene you can use the method in the 2nd attachment, with the 3rd being the end result. For both of these examples I just used basic colors, but you would plug your ocean color into the B slot on the first lerp (blue), a foam texture/panner into slot A (red), and if you want extra detail in your foam, add the second lerp with a detail foam texture/panner into the A slot (green).

Hope that helps, and great work on your shader, looks really good! :slight_smile:

Hi DotCam,

Right before you posted i stumbled on this blog which describes pretty much the same height based technique that you showed, i did try it and it works, but the height line is really straight and it doesn’t look too good, maybe adding more falloff would help mask that

About the second technique for shore foam, i have already tried the DepthFade and it works pretty well, the issue with that technique is that it requires a translucent material, when i set my material to translucent even with an opacity value of 1 i get some issues, you can read about it here, nobody has answered yet

Thank you so much for helping


I clicked on your signature link and realized that you had the exact same translucency issue (very nice shader btw!)

I’m definitely going to read through your post and read what you did to get this working

I figured you had probably seen similar techniques, also I forgot your using an opaque material, your scene is in deep water so it’s not really necessary.

The second part I can help with though, see here:

You will need to use a second mesh (with a second displacement only material), along with your original mesh in a blueprint (both with the same size and origin point), then set the second mesh material properties to “Render Custom Depth” and Not Render in Main Pass as shown in the link below, then add in the nodes shown in the thread by TheBeej, and it will get rid of the depth buffer issue. If you need more details than the info in the thread, just let me know, it is fairly straightforward, but will cost around a few fps to do this (nothing major, just like 2-4fps).


Let me know how it goes, I am working on an ocean system as well, translucency is working with reflections etc. I plan to release it to the community at the end so the people here who need an ocean surface have something to start with. My approach is the same as yours, slightly different than Handkors, but not by much, so far has 60 parameters to control while I fine tune the look, lot’s of fun. If you want to (if your project allows you to) add any input for my shader, ways to improve, or just general tips, I am all ears! Shoot me a PM any time (or post in the link in my sig) . :slight_smile:

Thank you so much for all the information

I will definitely give the Depth Buffer technique a try, the Depth Fade foam is really needed and even in deep water it would be nice to see the transparency where objects enter the water such as a raft or… sharks :slight_smile:

Your shader seems way more advanced than mine, you would be the one to teach me a thing or two!

Thanks man! Your’s has way better atmosphere, it really feels like you are there in a storm, and the SFX help too. :slight_smile: Let me know if you ever run into any snags, I have run into many of them as well, my main reason for doing this is to learn more advanced techniques, but has turned into a fun little project.

If you would like to see the full shader network, just let me know, it’s not a secret or anything, but is too large to post in the forums (I hate stitching screen captures together)… Let me know if it would help! :slight_smile: