Optimization?

Fairly simple question here. Does Unreal do optimization behind the scenes? Like, say I have 10 different materials, but they’re all using the same shading model, is that basically like having one shader with different settings? Does Unreal then take the textures and put them into an atlas, or does it have to load each one separately? Or, say I have two different models with the same basic settings for their materials, but they’re using different textures - should I be trying to make one material that will work for both, or just make two materials because it doesn’t matter for performance?

I’m just wondering if I should be working a certain way to optimize things or just not worry about it since Unreal is doing it for me.

yes

there is some optimization on cooking stage, but no, no atlases as far as I know

yes, and change texture parameters in material instances

You are wrong. Each Material is a different Shader.
You need to use Material *Instances *of the same Material to share shaders.

I meant that shaders works like construction blocks.
Shading model is also a block.
Of course you should create some materials hierarchy, and use material instances only as a set of parameters.

I think the general advice for materials is to use material instances. It gives a lot of advantages over multiple materials.
Unreal also uses texture streaming. So you could’t need to worry to much about that. Just keep your texture resolution at the power of two. (256, 512, 1024, etc)

Ok, so I AM doing it badly ATM. I have new materials for everything. It shouldn’t be too hard to fix, though. I’ve turned off spectacular on most of my materials and I’m using a lot of constants so it shouldn’t be too hard to whittle it down to just a few materials.

You should read this from top to bottom. Physically Based Materials in Unreal Engine | Unreal Engine 5.3 Documentation

The Specular input should not be connected and left as its default value of 0.5 for most cases.

Sure, if you’re trying to make something that looks realistic, that makes sense. I want solid colors, so I turned off specular. It’d be nice if Unreal would just let me make my own shaders so I could do this more efficiently, but whatever.

EDIT: I’ve come across this attitude so often using this engine. I want to do something and it turns out you just can’t because it’s been hard coded a certain way and that’s how everyone should be doing it. It’s been really frustrating, as an artist, trying to achieve something close to what I want. I just want to put this out there because your comment really hit me the wrong way and it’s the general theme of what has made my whole experience with Unreal really unpleasant. I switched over from Unity because I thought Unreal had so many more features. It turns out Unreal is just locked into a certain way of working and you can’t do anything interesting or outside the box with it.

With this particular thing, for once, I actually have control over it, and then here you are telling me I shouldn’t be doing that. Maybe even down the line they’ll remove that functionality. I just don’t get it, TBH…

I didn’t see that you where going for a more artistic result. If that is the case then sure, tweak the settings however you like! :slight_smile:
It was more that it reminded me of the first thing I did when I was working on a nature scene, which was to turn of specular because “grass should’t shine like that”.

Artistic control is very important! :wink:

Here’s my basic Material, which I use for pretty much everything:
0c5da8bf7a996011ed0917b5463b5456adf3598d.jpeg

This should give you a basic idea.

You can simplify this even more by removing the Scalar Parameters and the Tiling. which results in a pure PBR material how it should be but I like it to have control over Roughness and the Normal intensity

Sorry if I got a little angsty. I’ve had a lot of ups and downs on this project. 3D is hard, even with an engine. I feel like having an engine makes me a bit spoiled, too, and I start to think, “Why isn’t this a feature?! It so obviously should be a feature!”

You’re right that the first thing I turned specular off for was the grass. I loved how it made everything looks soft and velvety, and the different models blended together, so I did it for all the foliage and removed almost all the texturing. It has more of a painterly look that way - planes of colors. I’ve been thinking of it like how pixel art is made.

@Raildex_: Thanks for the demonstration. I’m thinknig I can probably whittle almost everything down to 2 materials. I’m really only using subsurface and Default.