[3.5.1] Excess string memory

I’ve been spending a lot of time trying to reduce overall memory consumption for CC 3.5.1 for Putt Party webGL mobile builds and one issue I noticed is that the built effect assets keep 3 copies of the complete (includes resolved into the shader) shaders for glsl1, glsl2, glsl3(?!) and all of those are loaded into memory. My project clearly specifies only to use webGL1, so I would expect to only have to pay the cost for that version of the shader.

The string memory just getting to the main menu of the game is over 6MB and a large portion of those strings are from these shaders. I made a quick engine hack to remove those extra shaders and it saved several MB in memory. When I load into the first scene of Putt Party, the string memory jumps up to over 12MB. Not all of those are from shaders, but it’s definitely part of the problem.

I don’t believe the build process is open source, so can someone on the engine team make it so that you only include shaders for platforms that are used?

Hi, we do generate shaders for glsl100, glsl300, glsl400, they are all needed for different platform and graphics backend. Before v3.6, many internal shaders are built into four large typescript files for easy loading, all of theses will be loaded during loading process, but this will be improved in v3.6, they won’t be loaded in typescript files, instead they will be loaded in effects assets files only when needed. So the string memory usage will be reduced in v3.6

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.