Jump to content

Reduce Size of PW_General_ShaderGraph_URP for Android


Recommended Posts

Hi, PW_General_ShaderGraph_URP is about 35mb of my build. How can I reduce its size? I am trying to optimize for mobile.

 

thanks!

Mia

Link to comment
Share on other sites

Ok so if the shader is a part of the always include shaders, then you can remove it from the list. 
image.png
image.png

If you know there are certain settings that you are not using in the shader you can open the shadergraph editor and delete the keywords at the bottom of the variables list: 
image.png

These Keywords add to the variants which might be what's increasing the build size. 

Link to comment
Share on other sites

thanks!

the PW_General_shadergraph_URP, doesn't show up in the settings. I know I am using it for sure because it pops up in my build size but it is not in the always include shaders. By the way, do you know if I need all these shaders? You had only 7 in your list.

image.png.d3f73a9efd9cfa2680eb08120a7508d5.png

///break//

How do I know which keywords I am not using? Or all the boolean ones you have below are not used? 

thanks!

Link to comment
Share on other sites

Those can be toggled options. 
For example the wind. This allows our vegetation to be affected by the wind. 
If you are using your own wind and own vegetation you don't need this. 

You can always make a back up or be in version control and delete these. 
Check all the scenes and see what you are not using etc. 

The shaders and how many I have vs yours is dependant on your assets in the project. 
So I would leave those alone it doesn't hurt anything. 
Unless you know for certain that you are not using them then you could remove some of them. 
 

Link to comment
Share on other sites

I see. So then based on my screenshots I cannot reduce the size of PW_General_shadergraph_URP file since it doesn't pop up on my build shader settings and I am relying on Gaia to do everything like vegetation?

Link to comment
Share on other sites

Also, do you know why the batches are so high in the scene? Is there something I should be optimizing for Gaia/Gena that I am not?

Link to comment
Share on other sites

7 hours ago, Mia said:

I see. So then based on my screenshots I cannot reduce the size of PW_General_shadergraph_URP file since it doesn't pop up on my build shader settings and I am relying on Gaia to do everything like vegetation?

You can always try to reduce them sure, but again this is depending on your project. 
You would just need to play around and see. 
Just make backups before doing so. 

Otherwise, you could use something like shader control. 
https://assetstore.unity.com/packages/vfx/shaders/shader-control-74817

Link to comment
Share on other sites

5 hours ago, Mia said:

Also, do you know why the batches are so high in the scene? Is there something I should be optimizing for Gaia/Gena that I am not?

You may still need to optimize meshes. 

This is mainly quality over performance and depends on you really. 
How much quality are you willing to sacrifice over performance. 
Deleting tris and poly counts and adjusting the lod's will all improve performance and reduce batching. 

Link to comment
Share on other sites

So I narrowed the slowness to some scenes, specifically the ones that use Gaia. The ones that don't are good.  I guess I don't understand how to optimize specifically the Gaia scenes for mobile.

Link to comment
Share on other sites

I guess what steps do users take that use Gaia on mobile? Wish there was just a mobile setting.

Link to comment
Share on other sites

It depends on the mobile devices that you are targeting, as it will tell you what specs you need to be in. 
Mobile is not easy to develop for as you cant have much in a project. 
Turning your textures down a lot will help something like 256 or 512. 
Reducing polycounts - decimate your meshes to the lowest part without looking bad. 
Reduce the terrain resolutions. 
Make sure your vegetation isn't that high poly. 
Instance as much as possible. 
Reduce shadows as much as possible. 
Dont use too many textures on the terrain. 

Honestly, the list goes on. 

Link to comment
Share on other sites

thanks! I don't want to break my terrain but how do I update the following in Gaia.

1. make vegetation low poly

2. remove shadows

3. reduce the render distance 

Thank you!

Link to comment
Share on other sites

1. You would need to make a custom biome and then use low poly assets for the spawners. 

2. If you click on a prefab it will have the option to remove shadows and contribute to global illumination. 
Turn these off on objects you want to. 
image.png

3. This would be culling and clipping planes on your camera. 

Link to comment
Share on other sites

thanks! looks like shadows were off already on game objects. Is there a way to turn off shadows on Gaia objects like trees and such?

So, do I need to completely create a new terrain to make it mobile compatible? There is no way to reuse the one I have?

Link to comment
Share on other sites

4 hours ago, Mia said:

thanks! looks like shadows were off already on game objects. Is there a way to turn off shadows on Gaia objects like trees and such?

So, do I need to completely create a new terrain to make it mobile compatible? There is no way to reuse the one I have?

You can you just need to go to their prefabs. 
After you do this refresh the terrain (through the terrain inspector). 

You can make your current map compatible its just a matter on time. 

 

Link to comment
Share on other sites

thanks!

So, I removed shadows on all the prefabs.

How do I refresh the terrain?

 

also, do I need to update the LOD settings? I do make it 1 in the build settings so not sure if it overrides. 

image.thumb.png.d608e1a28f2e329db534a10cbea206a6.png

thanks!

image.png

Link to comment
Share on other sites

thanks. I individually removed the shadows for each item but sadly the performance is not better. Do you think it might be better to remove the terrain all together for mobile? I am not sure how to further optimize it. Wish there was a button that updates the terrain to mobile.

Link to comment
Share on other sites

I see there is a synty asset that is combined with Gaia that can potentially make the terrain mobile friendly. Is there a way to update my terrain to use that that is not super complex to do? 

Link to comment
Share on other sites

I know recently someone used the game ready levels for mobile. 
Which are synty made. 

 

Link to comment
Share on other sites

How can I update my trees and terrain to low poly. Is there a way to do it without comprimising my terrain layout?

That asset works with procedural world and synty. It replaces terrain to low poly and trees to low poly. I would hope to just replace my trees and vegetation to the ones from this asset. Is there a way to do that?

Link to comment
Share on other sites

You can replace the trees in the spawner. In the resource of that spawner hit refresh prototype when you have replaced them. 

 

Link to comment
Share on other sites

that is great to hear!

1. is there a way to do it quickly or I need to do it spawn by spawn (which is 1000s)

2. Do I do it in my scene or prefab?

3. What are the steps to do it? I don't see an option when I click on the spawner.

thanks!

image.thumb.png.277f2ac50634bf845a20f1ddb47ed6f2.png

Link to comment
Share on other sites

in my screenshot above I already point this out. 
image.png
This is what you need to replace. 
After replacing this then hit the refresh terrain prototypes 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...