In my unity game that I am creating there are 4 scenes. 3 of those scenes rely on a backdrop because they are the main menu, death screen and the escape screen(for when you escape the place). Therefore they need a high resolution image. However, the other scene (the main game scene) is incredibly laggy when the quality setting for the texture quality isn't "eighth res". How can I make it so that the texture quality for only my game scene is eighth res and the rest is normal res? This might help: my build order value is the main menu is 0, my game is 1, my death scene is 2 and my escape scene is 3. thanks in advance
-
3\$\begingroup\$ This looks like an XY problem. You want your main game scene to not lag. You think you could make it less laggy by reducing the texture resolution in that one scene. But that might not be the right fix. You should instead ask "How to reduce lag in my game scene" and give us a Minimal Complete Verifiable Example, the steps for how to set up a scene that replicates the problem you're observing. Then we can help you address that root problem, whether the solution is texture resolution or something else. \$\endgroup\$– DMGregory ♦Commented Mar 18, 2021 at 11:44
-
\$\begingroup\$ This texture problem was one of the root causes for the lag and the reason i thought about it was because i saw it when I searched up how to reduce lag. I did fix this issue however and implemented a graphics ui setting for it. So now there are 3 different texture variations varying on which graphic setting you choose which I'm very proud of! Ill answer the question after i write this as well. \$\endgroup\$– ObjectCommented Mar 19, 2021 at 10:43
-
\$\begingroup\$ I also know it was one of the root causes because I experimented with the resolution setting and found large changes in frame rate when the setting was lower. \$\endgroup\$– ObjectCommented Mar 19, 2021 at 10:50
2 Answers
ok, so I approached this all wrong. I thought that this texture setting would be a build related thing however I realized that I could just change the setting via scripting. So I put an event system in each of my scenes and gave it this incredibly simple script: menu and others that aren't game scene (c#):
void Start()
{
QualitySettings.masterTextureLimit = 8;
}
public static int low = 0;
public static int medium = 0;
public static int high = 1;
// Start is called before the first frame update
void Start()
{
if(low == 1)
{
QualitySettings.masterTextureLimit = 8;
}
if(medium == 1)
{
QualitySettings.masterTextureLimit = 2;
}
if(high == 1)
{
QualitySettings.masterTextureLimit = 1;
}
}
When you import a texture into your game, you can set the texture resolution and quality settings different for each one.
Open up the directory with your textures in your Asset explorer, click on each texture, look at the Inspector window and then set the "Max Size", and "Compression" to the lowest setting which still looks good enough for the particular use-case of that texture.
More about texture import settings in the manual.