Questions regarding optimizing materials/textures

Hey, I have a few questions I have always wondered, but never quite understood.

  1. Is it more optimized to use one/a few master materials, and make many instances of those, instead of making a new material per model (even if you make an instance of that). In other words, you make a master material where you can set the basecolor, roughness, normal map, etc. in the instance. Or you make multiple materials where you can’t change it via the instance.

  2. Is it better to change resolution outside of the engine, and import them as the desired resolution than to use the LOD bias in the texture settings? I feel like it takes a second to load the lod bias in packaged versions, so it kind of flickers into the new set resolution. But I also guess it would be better for file size too?

  3. How much more demanding is it to use translucent materials than masked? Is there a clear difference?

  4. How should you be using high resolution textures?

  5. Do textures changing resolution based off of distance? I’m guessing thats what the texture streaming is for right?

  6. What texture streaming pool size is normal to have for open world games? Do you stick to the default value or increase it?

1 Like
  1. It’s really the textures that make a huge difference. Splitting hairs over whether a flexible master is better than lots of basic material doesn’t really matter unless you’re using a lot of materials in the level.

  2. If you set the LOD bias on a texture, that will dictate what gets packaged. So will make the package smaller.

  3. Translucent is more expensive than masked.

  4. Too vague :slight_smile:

  5. Yes, this is texture LOD streaming

  6. You can set the default to whatever you expect your typical gamer to have in VRAM. So, somewhere between 2 and 4 or more GB. I think the default is 1, which is very restrictive.

1 Like

Is it more optimized to use one/a few master materials, and make many instances of those, instead of making a new material per model (even if you make an instance of that). In other words, you make a master material where you can set the basecolor, roughness, normal map, etc. in the instance. Or you make multiple materials where you can’t change it via the instance.

Material instances are only slightly more performant than regular materials, if that. But, it is still of significant value to have several master materials with instancing just because of the time saving alone. Having to make an entirely new material that is basically a cut and paste of a material you already have with slightly different textures/coloring is a lot of unnecessary work.

Is it better to change resolution outside of the engine, and import them as the desired resolution than to use the LOD bias in the texture settings? I feel like it takes a second to load the lod bias in packaged versions, so it kind of flickers into the new set resolution. But I also guess it would be better for file size too?

I would think so.

How much more demanding is it to use translucent materials than masked? Is there a clear difference?

Significantly. Translucency is one of the heaviest things in the engine. Masked is much cheaper.

How should you be using high resolution textures?

That depends entirely on what you are trying to do.

Do textures changing resolution based off of distance? I’m guessing thats what the texture streaming is for right?

Yes. That is mip. It helps performance.
You can turn it off if you need to for your project, but most games probably wouldn’t do so. I would think turning off mip/streaming is more of an arch vis or other non-game UE thing.

Edit: Except for UI menus. Always turn off stream for UI textures.

What texture streaming pool size is normal to have for open world games? Do you stick to the default value or increase it?

I have no idea. I wish you luck with your open world though. Those games are huge.

1 Like

Thank you both for the answers! In regards to how translucency is more expensive than masked:

I have a bunch of trees that turn into planes at the lowest LOD. Its just two simple planes crossed over each other. I found that with masked, it would make it very obvious though that it was a plane, while translucency didn’t. Is there a way to achieve this with masked?

Here’s an example of how the trees are rendered differently:

This is with translucency:
image
image

And this with masked:
image
image

I do prefer how masked looks. But whats bugging me is how the light hits the plane. It makes it very obvious that it is a plane. I was wondering if there were some settings in the material that I could adjust?

Hi Skylene1,

You can optimize that tree plane even further into just one triangle - that will remove a lot of the blank area (still gets tested with opacity) - that actually provides quite a dramatic speed increase.

Regarding the way the light hits it, there are a number of things you can do - you can create a signed distance field of the tree, and use the values to calculate how much light to let through (adds light to the outside areas of the tree which can help) - also, you can create fake lighting similar to Octahedral Impostors.

I’ve got a tool on the marketplace (rdLODtools) that create single triangle LODs and can create textures of things such as AO that can be applied to the LODs - I’m also currently working on version 1.4 which has signed distance field maps and depth maps which you can use to add even more lighting type effects to those LODs without impacting your performance.

Hey, thank you for the tips! I’ll give it a try! :smiley:

1 Like

How would I be able to make it into one triangle? I tried to use the LOD reduction settings and set it as low as 0.0001 but its still 2 triangles and 4 vertices. Would I have to do this in a modeling program? I might be misunderstanding though!

It’s something I built into the rdLODtools plugin, it can’t be done from the reduction settings.

The plugin creates various types of LOD’s - the one that creates single triangles is called the “TriSprite” - it follows the camera so only ever has one snapshot, but from a distance you don’t really notice. The one that has two intersecting planes like you’re using is called the “Planar” LOD (in the tool anyway) - atm that uses planes too, but I’ll be converting that to optionally use triangles too.

1 Like