UniVRM icon indicating copy to clipboard operation
UniVRM copied to clipboard

Feature request: Option to exclude shaders from build

Open De-Panther opened this issue 9 months ago • 1 comments

Having all the shaders in the resources folders, forces them to be included in all builds, even if not needed. When building for platforms like web, it takes lots of space and compilation/build time to include shaders and shaders variations of the MToon. As the VRM Shaders package is a dependency of all the other packages, there's no way to exclude those files from the final build.

I'm not sure what would be the right solution. Having those shaders in the resources folder and in a dependency package, make it easy for new developers to use the VRM and GLTF packages. But it makes it less easy for developers who needs those customizations to exclude the shaders.

It also prints redundant error messages when using the Built-In render pipeline, as it try to build/compile URP shaders.

Some suggestions:

  • Remove the VRM Shaders package from the dependencies, and let the developers manually add this package. This way developers can decide if they want this package.
  • Have more Shaders packages, so there'll be one basic package for the UniUnlit shader which is a must, and another for the MToon shaders.
  • Move the shaders out of the resources folders, and allow developers to add those to the Graphics Settings. Maybe add an alert/error/warning the first time there's a build without them included there.

What do you think?

De-Panther avatar Oct 01 '23 12:10 De-Panther