One of my favorite uses for world position gradients is adding color banding to rock cliffs, can really help make separate textures for different rock assets blend together.
Pro Tip: For skeletal meshes you can use a [Pre-Skinned Position] node to take a gradients from skeletal mesh and [Pre-Skinned Local Bounds] to scale thouse gradient to proper values. Its more cheaper then generating extra UV for skeletal mesh. Because UE is optimised to store UVs by pairs (mainly because of auto light maps). So using single UV is the same as two UV, and using three UV is equal for performance as four.
Oh, I didn’t know that about uvs being stored in pairs, that’s interesting. Preskinned is good for a gradient, I probably should have mentioned it - good tip!
@@visualfinesse7445 you basically just do the same thing twice! So gradient between colours a and b, and then again between the output of the first lerp and colour c
@@gherson13 I believe there’s a material function for lerping 3 colours in the engine you could look at. But basically you just do the same process twice - lerp between red and pink with one gradient then the result of that and blue with another gradient
Thank you! Exactly what I was looking for! edit: Using the newest version of UE5.1, the vertex interpolator does not seem to work, all of my foliage assets are using the gradient not per instance but per the whole group.
They Tom, would you have any tips on where to start as far as a vehicle customization system for liveries/paintjobs? I have looked and there is very little information from what I've seen so far, I would like to explore how one might be able to 'paint' a vehicle with preset shapes for example and then store that image somehow. Welcome back by the way!
@@gillgonzalez8479 sounds like a lot of moving parts that could cause this to break unfortunately. Generated foliage and nanite could both upset the object pivot data needed for the gradient
@@gillgonzalez8479 I've not really used PCG and nanite as you're describing but if you're generating the trees then you should also be able to generate vertex colour or uv's that have a gradient similar to what is being made in the video.
You can take the object rotation into the material and do some calculations with that, but if you want it completely relative, just use uvs / textures / vertex colours on the model instead of a procedural gradient
Hi there and thank you for awesome content as always )) I have a question. Could you make a video about dynamic dirt masking for characters? For example, if character fell down on his back, his back gets dirty and so on. I cant find any tip or tutorial for that. Thank you again.
Thanks for this! How would we go about adding some irregularities to the gradient mask? Im using the world position technique you go through and Id like to make it so that the gradient isn't so straight. I've tried multiplying a noise texture but not getting what I'm looking for. Im assuming its difficult with WP.
This comment is a year late but, I can't seem to get this to work with Landscape grass. Object position seems to return an arbitrary value so subtracting it from the world position doesn't provide an equal gradient across different "Chunks" of landscape. Any ideas?
Instanced static meshes like grass will give you the position of the group, rather than per object - if you check out my video on the vertex interpolator, you should be able to use that to get per instance position, instead of the whole group
@@tharlevfx I actually did try using the vertex interpolator, I'm in unreal engine 5.3.2, unfortunately that didn't work I was getting different colors in different squared off areas where the grass was generated as a group. Interestingly the color was indeed correlated to the height of the object group. Nonetheless, It does work with foliage, and I just used a UV height gradient for the grass since it's not a complex mesh.
@@tharlevfx Yeah it does indeed seem to do this. thankfully for grass using the UVs is sufficient! Also I want to thank you for all the information you've put out and for your quick replies!
Nice Work 🙂 Keep it Up! 💪 Is it possible to use World Position Offset in a Post Process Material? My Goal is Curved World Post Process World Position Offset Effect.
@@felixstief7830 foliage is an instanced mesh so it will do as you say. If you check out my video on the vertex interpolator you can get the instant position with that and then do your gradient calculation
Depends exactly what you want - you could rotate the mask around a known point and get a diagonal that way, or add two masks in different directions to get something diagonal
can we somehow generate a gradient running from UV island's borders in ue5? looking for an effect like in painter's modifiers for a non map solution for creating SSS for plants without a map
Do you mean like a flood fill gradient per uv island? I’m not sure that’s possible I’m afraid - you would need to use either uv space, world space or local space and author things correctly for that
@@tharlevfx True, but I thought in code the world agreed to use US spellings :3 Anyway, as long as you still use meters, I think there is hope for a friendship :P
I love you man, This is the only video on the whole internet that explains hwo to actually do gradients
One of my favorite uses for world position gradients is adding color banding to rock cliffs, can really help make separate textures for different rock assets blend together.
I remember us having the same foliage height-based issue some time ago on this very channel , glad to see a workaround.
This is what I really needed. Thanks man!
Pro Tip:
For skeletal meshes you can use a [Pre-Skinned Position] node to take a gradients from skeletal mesh and [Pre-Skinned Local Bounds] to scale thouse gradient to proper values.
Its more cheaper then generating extra UV for skeletal mesh. Because UE is optimised to store UVs by pairs (mainly because of auto light maps). So using single UV is the same as two UV, and using three UV is equal for performance as four.
Oh, I didn’t know that about uvs being stored in pairs, that’s interesting. Preskinned is good for a gradient, I probably should have mentioned it - good tip!
Nice video man, i always wanted to learn this kind of stuff, i love your tutorials!
thanks again tharle! :D top level content as always!
Great!!! I am waiting for it!!! You are a master! :)
you are a hero
There's 3d modelling and UV tooling built into UE5 now, so if doing the last method might be worth giving those a look
I was really hoping you would show us how you did the triple -color gradient. I've been working on this for a while now and can't figure it out.
@@visualfinesse7445 you basically just do the same thing twice! So gradient between colours a and b, and then again between the output of the first lerp and colour c
Hello, really nice tutorial, do you know how to make this with three colors instead of 2? the same as the one that you have, red-pink-blue?
@@gherson13 I believe there’s a material function for lerping 3 colours in the engine you could look at. But basically you just do the same process twice - lerp between red and pink with one gradient then the result of that and blue with another gradient
@@tharlevfx amazing thank you
Thank you! Exactly what I was looking for!
edit: Using the newest version of UE5.1, the vertex interpolator does not seem to work, all of my foliage assets are using the gradient not per instance but per the whole group.
Found the same issue. I don't believe you can use the VertexInterpolator in this way if your mesh uses Nanite.
@@Fafmagic Disabling nanite on the assets might help
Anyone found a workaround using the vertex interpolator node, does not seem to work in Unreal 5.3. Even when disabling nanite
I would also add vertex colors as an option.
Yeah vertex colours are super powerful too but I’m not sure they’re dynamic in the same way. Very useful though!
Thank you very much
thank you very much for the info ... saved my life XD
They Tom, would you have any tips on where to start as far as a vehicle customization system for liveries/paintjobs? I have looked and there is very little information from what I've seen so far, I would like to explore how one might be able to 'paint' a vehicle with preset shapes for example and then store that image somehow. Welcome back by the way!
Can you email me with some images of what you mean? I’ll have a look!
@@tharlevfx Done!
usefull video thanks for that
I cant get this to work. Im using PCG nanite trees with the vertex interpolator and its still treating it ike a height based gradient.
@@gillgonzalez8479 sounds like a lot of moving parts that could cause this to break unfortunately. Generated foliage and nanite could both upset the object pivot data needed for the gradient
Hey thanks for the lightning quick reply. Do you know of any work arounds by that i could try?
@@gillgonzalez8479 I've not really used PCG and nanite as you're describing but if you're generating the trees then you should also be able to generate vertex colour or uv's that have a gradient similar to what is being made in the video.
I made the gradient horizontal, but when I rotate the object the gradient changes, how can I make the gradient completely relative?
You can take the object rotation into the material and do some calculations with that, but if you want it completely relative, just use uvs / textures / vertex colours on the model instead of a procedural gradient
Hi there and thank you for awesome content as always )) I have a question. Could you make a video about dynamic dirt masking for characters? For example, if character fell down on his back, his back gets dirty and so on. I cant find any tip or tutorial for that. Thank you again.
Any way of lerping more than 3 colors in a gradient without using a gradient map? E.g. 10, 20 or 30 gradient color points?
Not without some crazy complex math. If you want that level of control you can use an engine curve asset and import it into the material
Is it possible to expose the color curve asset key/gradient stop values in parameters to set the values dynamically through blueprints?@tharlevfx
Hey man do you think you will make videos about the new Strata Materials when they're out?
i'm sure i will!
Thanks for this! How would we go about adding some irregularities to the gradient mask? Im using the world position technique you go through and Id like to make it so that the gradient isn't so straight. I've tried multiplying a noise texture but not getting what I'm looking for. Im assuming its difficult with WP.
Adding a texture gradient to your gradient is how I would add some irregularities.
This comment is a year late but, I can't seem to get this to work with Landscape grass. Object position seems to return an arbitrary value so subtracting it from the world position doesn't provide an equal gradient across different "Chunks" of landscape. Any ideas?
Instanced static meshes like grass will give you the position of the group, rather than per object - if you check out my video on the vertex interpolator, you should be able to use that to get per instance position, instead of the whole group
@@tharlevfx I actually did try using the vertex interpolator, I'm in unreal engine 5.3.2, unfortunately that didn't work I was getting different colors in different squared off areas where the grass was generated as a group. Interestingly the color was indeed correlated to the height of the object group. Nonetheless, It does work with foliage, and I just used a UV height gradient for the grass since it's not a complex mesh.
@@BeginnerDev oh, landscape grass - yeah I think that might give the value for the landscape tile it’s on.
@@tharlevfx Yeah it does indeed seem to do this. thankfully for grass using the UVs is sufficient! Also I want to thank you for all the information you've put out and for your quick replies!
Nice Work 🙂 Keep it Up! 💪
Is it possible to use World Position Offset in a Post Process Material?
My Goal is Curved World Post Process World Position Offset Effect.
dosent work on my foliage for some reason, it takes the whole foliage as one obj
@@felixstief7830 foliage is an instanced mesh so it will do as you say. If you check out my video on the vertex interpolator you can get the instant position with that and then do your gradient calculation
is there any way to make diagonal mask?
Depends exactly what you want - you could rotate the mask around a known point and get a diagonal that way, or add two masks in different directions to get something diagonal
It's honestly weird you can't just request the local vertex position. Thanks for the subtraction tip!
can we somehow generate a gradient running from UV island's borders in ue5?
looking for an effect like in painter's modifiers
for a non map solution for creating SSS for plants without a map
Do you mean like a flood fill gradient per uv island? I’m not sure that’s possible I’m afraid - you would need to use either uv space, world space or local space and author things correctly for that
@@tharlevfx thanks, yes. Makes sense! That was a very fast reply :D
After all those years I've been a subscriber and I just realized you write color wrong.
Can't believe you stabbed me in the back like that 🔪
Haha, did the English accent not give it away?!
@@tharlevfx True, but I thought in code the world agreed to use US spellings :3
Anyway, as long as you still use meters, I think there is hope for a friendship :P
@@yonjuunininjin I think that might be a lie Americans tell themselves :)
I Can use This feature In my games
Yeah of course!
@@tharlevfx thank you so much