Ah that is interesting, didn’t know that, I always thought any texture sample you plug into the material regardless of nodes will always occupy that space.
Thanks again.
Ah that is interesting, didn’t know that, I always thought any texture sample you plug into the material regardless of nodes will always occupy that space.
Thanks again.
Ah oops, yeah.
Tbh, I think @MostHost_LA’s render target idea is the way to go. It’s actually super simple and would have no runtime cost (cuz render targets are just like textures). Just make a single render target in you’re asset folder and put that into the material function. Then, for each level in the level blueprint, draw a texture to the render target. You don’t need the materials to be instances since the render target is a texture.
All the assets you will need:
Steps:
global_tex_rt
. Make sure its resolution is set to what your textures will be.global_tex_func_lib
and put this in it:global_tex_mat_func
and put a texture sample that uses global_tex_rt
in it. NOTE: If the material function only contains a texture sample, don’t use a material function; just use the texture sample directly in the material itself.global_tex_mat1
& global_tex_mat2
in the example). The materials do not need to be material instances since the render target is a texture and will update itself.Here’s the result:
They use the same texture, one just modifies the colors to show they’re different materials.
You can actually use a custom function to do the same thing at runtime.
Optimizing dynamic landscape materials doing this (although a bit of a nightmare) worked very well for .24
Basically the landscape default stuff always uses texture samples.
Using the custom node you can try (because it’s not always a guarantee) to stop that from happening when layers aren’t painted in at all.
You can find some info along with the flames here
Using a static parameter will definitely work with the a custom node containing an if and 2 inputs.
Using a scalar may or may not depending on who knows what.
As I said there (or if not I’ll say it here now again) there was a definite performance benefit when checking if a layer painted and valid or not for landscapes.