sixways / unityshaderstripper Goto Github PK
View Code? Open in Web Editor NEWModular utilities for shader stripping to drastically improve Unity build times
License: MIT License
Modular utilities for shader stripping to drastically improve Unity build times
License: MIT License
Does this work in 2019.3?
Hey there,
First off, thanks for writing this plugin. When it works it's awesome. A fast and effective way to reduce runtime memory usage and build times when used carefully.
However it seems that the repo hasn't been maintained since ~2019. Are you open to adding a maintainer or two to help keep it working smoothly?
The currently pending PRs are essential to get this plugin in a workable state, and so far I've found two YAML parsing errors that cause USS to fall over at build time (exceptions in Initialize
). I assume Unity's YAML serialiser has gradually changed over the years, causing the parser to fail past a certain version.
DarwinAnim8or has a fork that merges in the PRs, which gets it mostly up and working (thanks DarwinAnim8or!). However those YAML parsing errors mean even that fork will almost certainly not work for recent versions of Unity (we found them in 2021 at the very least) since multi-line inline objects seem to be very common in our .shadervariants
file. You'd have to be extremely lucky to get all inline objects serialised on the same line for the lines beginning with - first:
.
I would love to get those PRs merged in and fix up the parsing bugs I've found.
In the meantime, I'm going to open PRs for each parsing bug and open a fork with them pre-applied, in case someone else runs into the same issues and needs a fix (and maybe isn't confident enough with git to apply the PR patches themselves). EDIT: Fork located here.
Thanks,
Brandon
hi, i tried the tool and it sort of work, wondering if there is anything can be done to improve the issue
so, the set up is typical model prefab AB, where FBX imported in unity with/without ImportMaterial set to true(which will leave the default material in-link with the imported mesh), then make a material using a in-project shader, and assign to the model renderer, then make it a prefab, and mark as AB output. then i tried build this AB with and without your tool active, the following is the result AB compare in size
the one on the left is built with your tool active(which was set to strip out Resource/built_in), the right is built without your tool active. the standard shader in the left one really got deminished(suggested by the size), but if you look closely, all the mesh in the one on the left are now bigger that the one on the right, and ultimately, making the one with shader stripping done, is slightly bigger than the one that has no shader stripping, due to the mesh size increase.
yeah, the tool does work and deminished the standard shader to the minimum, but somehow (i have no clue why) this leads to all the mesh in the AB got increase in size, which really beating the purpose of stripping the shader from indi AB in the first place.
really hope you hav the time to look into this, cheers mate
i use these scripts to build assetbundle for shaders, and found out that the shaders are where stipped,but if the shader variant asset is not in the same bundle with shaders, the shader load when running is not correct ,why?
Tell me if i'm wrong, but i think all scripts could be placed in the Editor folder so that they don't end up in the build.
Using Variant Collection which I collect using prewarming current scene, and in build I only build that scene, so my guess is those shaders are all I need to include. The build time cut by 7/8 ( 8 hours to 1 hour ) which is nice, but everything is pink.
Hey, thanks a lot for sharing this tool !
I think it could be better to create a release and provide a .unitypackage
file instead of downloading the repo as a zip.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.