Animated Layered material depth?

Hi, im a 3d artist but also a newbie to unreal and this is my first post.

I’m trying to create a layered material, where the top layer decays into the bottom layer. with a noticable height difference between them.

This is my material layer blend, it animated the top layer away to reveal the bottom layer quite well. the sine will later be replaced by an ingame function.

I wanted to copy this node setup into my layer master, and turn the animated texture into a normal map. When i started it seemed like an easy task, just use a node that turns grayscale into normal, but i cant get the desired result. i’ve watched various tutorials to learn the functions and limitations of each node, but i fail to find a way to get the result i want. (is it possible that the calculating a moving texture to a moving normal is not possible?)

Below you will see what nodes i’ve tried, the NormalFromHeightmap does not accept my method as it wanted a TextureObject.

i dont know how to continue at this point, if im close to it or if there is a far better way to achieve what i want. i’m open to anything, even wildly different solutions to have something decay to reveal what is underneath underneath.

the alternative im currently facing is to simply make a slightly smaller inner mesh that is revealed after applying a growing opacity mask to the outer mesh. but that is a can of worms i dont want to open since this is meant for modular level pieces.

Any and all advice or feedback is highly appreciated.

Change the heightmap into a texture object, and feed the multiplier from the time stuff into the intensity pin. Can drag a texture sample off the object to make the mask.

Sorry it’s kinda messy.

That said, unless the height is going to be procedural somehow, might be better off just baking the normal out and using a height lerp to blend the layers.

Hello! thank you so much for your reply, i probably should’ve been more clear that both textures are meant to be flat.
Below you see the transition effect i wish to use between textures.

Placing that in the lerp for the basecolor works fine. but trying to use this for normal intensity gets me only so far. the normal is applied to the entirety of the top layer, when i want to simulate that the top layer recedes to reveal the bottom layer, and only having normal data around the edges.

I think if i add a few nodes that create slightly weaker effect and subtract that from what goes into the normal intensity, i should see only the edges light up. im going to experiment with that for now, but i hope you’ll take some time to reply still if you got any other ideas!

im still open to different solutions where an outerlayer decays to reveal a bottom layer that is intuitive to do. wether it’s with materials or mesh or some feature i yet know nothing about.

small update.

the thing i wanted to try sort of works. i get a normal map through the edges now, but of course i cannot slope them where it makes sense. it would be required to bake every frame, convert each frame to a normal map, then make a video file out of those normal maps and then stick it in which sounds like too much work.

here is the final result at the moment, as you can see there’s normal data peeking through where the textures switch from one version to another but it doesn’t look all that great and gives no real impression of depth between the layers.

inverting it does make it look a little better. but im afraid ill have to give this up and try something more mesh based.

(multiple posts because im a new user and link limit is 2 per post)

I didn’t get as far as only showing edges, so you’ve made more progress than me. Did manage to only show normals during the transition though by using an absolute node with the sine and inverting it.

Looks a bit mushy as it approaches the top texture, but, yea.

It might not be a bad idea to open the default NormalFromHeight function, and copy the logic into a new function. Then tweak it to accept a texture sample as an input, which would mean you could apply contrast and/or map range at the height info first to tighten up the edges.

Forcing the NormalFromHeight to accept texturesample would solve my problems, ill look into it when the need arises again. For now i’ve decided to simply model the depth for my project. looking further into it it doesn’t create as many problems as i anticipated.

thanks for all your input :slight_smile:

1 Like

Oops. Maybe there’s no way to input a sample after all.

I had a go at taking apart the function and putting it back together with duct tape, and came up with this:

which continues here…

The material then looks like this:

Could probably use some contrast, but it might be getting expensive. Although, I did strip out the channel selector stuff (it only uses red from the tex obj), so maybe not too bad?

i haven’t the first clue on what becomes expensive or not when developing so its probably a good thing i changed course :sweat_smile: