Skip to content
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

Standard Shader Export - NotImplementedException When Occlusion and Metallic Resolutions Do Not Match #1178

Closed
FlameSoulis opened this issue Sep 1, 2021 · 2 comments
Labels
bug Something isn't working exporter
Milestone

Comments

@FlameSoulis
Copy link

Environments:

  • UniVRM version: 0.81.0
  • Unity version: Unity-2019.4.13f1
  • OS: Windows 10

Describe the bug

  • When exporting an avatar with an Occlusion texture that is a different size than the Metallic texture, console returns NotImplementedException: The method or operation is not implemented. rather than report a more helpful error (Resizing not implemented, please ensure Metallic and Occlusion textures are the same size!).
  • ConsoleLog:
NotImplementedException: The method or operation is not implemented.
VRMShaders.OcclusionMetallicRoughnessConverter.Export (UnityEngine.Texture metallicSmoothTexture, System.Single smoothness, UnityEngine.Texture occlusionTexture) (at Assets/VRMShaders/GLTF/IO/Runtime/OcclusionMetallicRoughnessConverter.cs:98)
VRMShaders.TextureExporter+<>c__DisplayClass8_0.<RegisterExportingAsCombinedGltfPbrParameterTextureFromUnityStandardTextures>b__0 () (at Assets/VRMShaders/GLTF/IO/Runtime/TextureExporter.cs:97)
VRMShaders.TextureExporter.Export () (at Assets/VRMShaders/GLTF/IO/Runtime/TextureExporter.cs:34)
UniGLTF.gltfExporter.Export (UniGLTF.GltfExportSettings meshExportSettings, VRMShaders.ITextureSerializer textureSerializer) (at Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs:381)
VRM.VRMEditorExporter.Export (UnityEngine.GameObject exportRoot, VRM.VRMMetaObject meta, VRM.VRMExportSettings settings, System.Collections.Generic.List`1[T] destroy) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:229)
VRM.VRMEditorExporter.Export (UnityEngine.GameObject exportRoot, VRM.VRMMetaObject meta, VRM.VRMExportSettings settings) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:24)
VRM.VRMExporterWizard.ExportPath (System.String path) (at Assets/VRM/Editor/Format/VRMExporterWizard.cs:301)
UniGLTF.ExportDialogBase.EndGUI () (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:161)
UniGLTF.ExportDialogBase.OnGUI () (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:82)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
UnityEditor.DockArea.OldOnGUI () (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <356f1ddb1d524ad59c7a2c95775bb38e>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
  • Screenshot 2021-09-01 02 06 36

  • Reproduction procedure:

    1. Set up a standard material that uses a metallic texture and occlusion texture. Textures should NOT match in resolution.
    2. Apply the material to avatar and begin exporting process.
    3. Export process will fail with the above error message.
  • Possible solutions:

    1. Update message (for now) with more informative error.
    2. Offer resizing services to match resolutions. Which resolution to use (higher or lower) will be up for debate.
  • Solutions that work now:

    • Resizing the textures to match resolution resolves the issue. Additionally, performing the channel operations (Metallic -> R, Smoothness -> A, Occlusion -> G) manually in an image editor like GIMP solves this issue.
@FlameSoulis FlameSoulis added the bug Something isn't working label Sep 1, 2021
@ousttrue ousttrue mentioned this issue Sep 1, 2021
@ousttrue ousttrue added this to the v0.83 milestone Sep 1, 2021
@ousttrue
Copy link
Contributor

ousttrue commented Sep 1, 2021

Thank you for your report.
I will implement exporter with OcclusionMap separated or implement Blit like importer.

@ousttrue
Copy link
Contributor

ousttrue commented Sep 9, 2021

v0.83.0 implement shader version

@ousttrue ousttrue closed this as completed Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter
Projects
None yet
Development

No branches or pull requests

2 participants