-
Notifications
You must be signed in to change notification settings - Fork 490
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
How to Build Unity Game using UnityGLTF (Shaders problem)? #206
Comments
Including GLTF/PbrMetallicRoughness.shader delete error message but something not work fine. This is in player: THIS THE CORRECT VISUALIZATION IN EDITOR: This test is done with: Versions |
GLTF Models of test: PBR Texture work fine in Editor NOT in Player Build: |
Perhaps I found how to fix the issue.This works with (but I suppose also for other Unity versions):
NOW ALL WORKS! Please confirm if my fix is corret and I will close the issue here. |
Sounds good. It would be great if you could send out a PR |
This works on 2018.2. Managed to build the app for android! |
As request by @blgrossMS: |
I get black model with no textures after testing your steps @Vytek what am I doing wrong? The console/log doesn't give any error on mac or android. |
Which version of Unity? Check shader Variant perhaps it use also other shader? If not add it and retry! |
I have just fixed my problem with the black textures on Android and Mac. I had to keep the shaders loaded in the build settings. This flag should be required? By enabling it and fixing the load of the shaders will create any problem? This issue is related to this other issue too, users might get black textures even after following the previous steps due to GLTF embedded model: #214 |
I think so ;-) |
Think what? |
Noting that if you do use the saved shadervariants asset approach, the file needs to be refreshed if any new variants are introduced in GLTF files (MASK and BLEND alpha modes, in my case). Otherwise Unity might not include the new variants when building to Android. |
Please update to the latest version and open a new issue if the problem persists. Thanks! |
This is my Unity config:
Versions
Unity: 2017.3.1f1 (fc1d3344e6ea)
VRTK: 3.3.0 (may not be correct if source is GitHub)
SteamVR: 1.2.3
VR Settings
Standalone: None, OpenVR
Scripting Define Symbols
Standalone: VRTK_DEFINE_SDK_STEAMVR;VRTK_DEFINE_STEAMVR_PLUGIN_1_2_1_OR_NEWER;VRTK_DEFINE_STEAMVR_PLUGIN_1_2_2_OR_NEWER
WSA: VRTK_DEFINE_SDK_WINDOWSMR
WSA: VRTK_DEFINE_SDK_WINDOWSMR
I am workin on:
Version system: macOS 10.13.6 (17G65)
Version kernel: Darwin 17.7.0
In Editor all works fine. But when I am trying to build my demo I have in log:
07-20_08-56-30: Console Log (Exception): ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
UnityGLTF.StandardMap..ctor (System.String shaderName, System.Int32 MaxLOD) (at <6e2e72fb449c4779bd7a6f55349ab1e6>:0)
UnityGLTF.MetalRough2StandardMap..ctor (System.String shaderName, System.Int32 MaxLOD) (at <6e2e72fb449c4779bd7a6f55349ab1e6>:0)
UnityGLTF.MetalRoughMap..ctor (System.Int32 MaxLOD) (at <6e2e72fb449c4779bd7a6f55349ab1e6>:0)
UnityGLTF.GLTFSceneImporter.ConstructMaterial (GLTF.Schema.Material def, System.Int32 materialIndex) (at <6e2e72fb449c4779bd7a6f55349ab1e6>:0)
UnityGLTF.GLTFSceneImporter+c__Iterator11.MoveNext () (at <6e2e72fb449c4779bd7a6f55349ab1e6>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <4b58939e897a4c34942efe344ae250a9>:0)
So I am trying to include shader in "Graphics" settings as file:
But the build doesn't works. Unity freeze on creating globalgamemanagers.assets:
https://answers.unity.com/questions/918996/unity-5-freezes-while-building.html
Now I include GLTF/PbrMetallicRoughness.shader in Assets/Resources dir, but I have seen that PBR Materials doesn't work fine :_(
How to fix the issue? I would like to write a little guide of how create a perfect build with UnityGLTF.
Thanks you!
The text was updated successfully, but these errors were encountered: