Textures/Materials

Hello, recently I have been activly trieng to remove any possible lag sources from my game, since it’s going to be a huge open world map. I was informed that legacy materials and decals do the lest amount of lag if any in a game. That got me wondering, if legacy materials are pbr textures, shouldnt they make the game lag the most? I’d like to use material manager to upload my textures, but would that cause any lag? And how about ai generated material varients? Do they cause lag too?

2 Likes

#help-and-feedback:building-support or
#help-and-feedback:game-design-support

Materials don’t directly cause lag. It’s the amount of parts that need to be rendered that does. Also, the amount of triangles on meshes will also impact the lag. The only material with a good preformance boost is SmoothPlastic, because no texture renders at all on the part.

how about pbr textures, why do they cause so much lag?

It’s like 2-4 textures actually being used. One is the phenotype, and the others determine how light reflects on it. Light reflections is hard math.

ik what pbr is, my question was why they cause lag

Light reflections is hard math.

oh. But if pbr textures are hard to render, why do legacy materials cause no lag at all?

They have no advanced light reflections from what I remember. SmoothPlastic is the most preformant material because it doesn’t render a texture at all.

aha! Thats why 2022 textures are so laggy. Do those materials only use 1 map? If yes which or is it something totally different?

I find eliminating some high part models seems to work somewhat well, I usually change them into meshes which might add more lag if you put in too many. so don’t put in like 6 billion meshes in it won’t help at all

  • Having a ton of textures and decals may slightly cause lag but that’s only if you have a ton
  • A lot of complex meshes can cause lag, like high tri count
  • The scripting can cause lag (I suggest you lookup how code can cause lag because there’s a ton of ways)
1 Like

And what if you create a Material Variant without a single texture? It turns out there is no texture, even when exporting an object there is no texture

Where’s the smooth plastic material then?

image

I’ve always thought smooth plastic still counted as a texture. After checking within the textures folder I guess it’s not?? I edited my last reply to remove that. I guess SmoothPlastic could be more performant but It’s not really worth sacrificing nice materials for performance reasons because the performance boost will pretty much never be noticable

I find that in games with big maps that use post processing, turning on a setting that removes textures (setting to SmoothPlastic) gives me 20-30 more fps.

I have to disagree on the very first statement. PBR doesnt render 1, but 3-4 textures at one time, what I meant is that out of all options how I can implement images on my objects, PBR Textures would be most performance costly because of that fact. I even tested my game with and without them and saw an impovement in performance. We also have to consider mobile players, whoms devices arent really capable to render them, since a lot of complicated math is involved. Normal textures which only use ColorMap as I hered are theoratically better, but they cover only 1 side, which means you need more of them. And more textures = more rendering = more lag

YES, there are even tutorials on how to do it cause its a widly spread problem

I didnt quite have come to a solution yet and need a bit further help. Rn I decided that publishing custom Materials with only the colormap would be the best option? But maybe there are other possibilites I didnt consider?

Okay well I think some things I’ve read on materials is wrong then, I’m just going to remove all the material related stuff from my reply so It’s not misleading.

The thing I said about decals and textures still applies, especially semi-transparent textures/decals. Other than that here a ton of things that could cause lag, do you mind sending screenshots of different parts of your map?

everything has figured itself out