-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PBRGraph shader size in memory is too much - 433.2 MBs #792
Comments
Hey @umeraamir-arthur, instead of adding the shaders directly to the "Always Included" list, use the Shader Variant Collections that ship with UnityGLTF. By adding them to "Always Included" you are including ALL potential variants, for any combination of Unity rendering features, including ones that Unity would otherwise strip. So: please use the Shader Variant Collections instead :) |
Yes and by adding directly to "Always Included" shaders we usually have to wait for 3 hours for first build to create them in Library folder and people hates me for that :D |
They’re here: https://github.com/KhronosGroup/UnityGLTF/tree/main/Runtime/Shaders/VariantCollections There included in the latest release already. There’s no extra variant sets for different features, these should „just work“ and absolutely not be as big as what you saw with „Always Include“. |
Hey, yes...that's correct 👍 |
Thanks @robLE83 !!!
I think I don't need to change anything for Shader Variant Collections to initialize. Rest of the things are handled by UnityGLTF... right? For both shaders i.e. PBRGraph and UnlitGraph? |
Any suggestions on how to remove this shader completely if there is no GLB in the scene. And as soon as we place any GLB in the scene then it can load the shader, maybe? |
Yeah, that's "by design". This is to avoid loading/compiling a shader when you instantiate a model which is using such a shader. Otherwise you would first see a pink material until the shader is ready for rendering (or you would have frame drops in this moment). Not perfect for low-end platforms, but i'm not aware of any solutions :/ |
Yes that would be an issue. I remember once I was profiling GLTFast and there shader was adaptive from scene to scene. On one scene it was ~100MB and on the other scene it was ~200MB.... Idk what were they using never explored it after then. |
I believe actually Unity 6 supports dynamic shader loading – haven't tested
it yet though.
…On Tue, Oct 29, 2024 at 12:29 PM umeraamir-arthur ***@***.***> wrote:
Yes that would be an issue. I remember once I was profiling GLTFast and
there shader was adaptive from scene to scene. On one scene it was ~100MB
and on the other scene it was ~200MB.... Idk what were they using never
explored it after then.
—
Reply to this email directly, view it on GitHub
<#792 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAURVUHE4XCVI3LVT75LBM3Z55WQFAVCNFSM6AAAAABQTC277SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBTHE2TINRXHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi!
I was wondering why this PBRGraph shader has this much size in memory even though if I've no GLBs in the scene. I can surely place any GLB at runtime but currently at the time of this memory capture there was no GLB present in the scene.
I've included both UnityGLTF shaders in my project Graphics settings because we don't have any GLB in the scene but we can place any type of GLB at runtime.
We don't support draco, GPU instancing or these things so I was wondering if there is any way that I could remove some parts from this shader referring to these things and my apps memory will be saved in some way?
Any suggestion would be appreciated, Thankyou
cc. @pfcDorn @hybridherbst
The text was updated successfully, but these errors were encountered: