needle-tools / needle-engine-support

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible and includes networking and XR - across platforms. Documentation at https://docs.needle.tools
547 stars 46 forks source link

GLTF+Separate using GLTF Object component with UnityGLTF has THREE.GLTFLoader: Couldn't load texture errors in local server #138

Open ROBYER1 opened 1 year ago

ROBYER1 commented 1 year ago

Describe the bug πŸ’¬

I imported a model in Assets > Models > F35B and imported it into the scene, added the GLTF Object component to it and ran in local server. on load I get:

debug_overlay.ts?v=b0654be5:50 THREE.GLTFLoader: Couldn't load texture tex/F35_v1_FBX_F35_Interior_Normal.png

I did click fix all textures on the UnityGLTF import menu in inspector to fix imported texture colour space on first import. The model is a gltf+separate file which might be the cause, a .glb embedded of the same model works fine the same workflow, this only happens with GLTF+separate.

image

Operating System πŸ‘©β€πŸ’»

Windows

What browsers are you seeing the problem on? πŸ„β€β™‚οΈ

Firefox, Chrome

Editor Version 🎲

2022.x

Needle Exporter version

2.67.6-pre

Project Info (Unity only) πŸ“œ

{
  "ExportInfoGameObjectName": "Export Info",
  "ExportInfoGameObjectIsEnabled": true,
  "UnityProjectPath": "C:/Unity_Projects/EatonInteractive/Assets",
  "UnityVersion": "2022.2.12f1",
  "SceneName": "MainScene",
  "ProjectPath": "Needle/MainScene",
  "ProjectDirectoryExists": true,
  "ProjectIsInstalled": true,
  "NeedleEngineInstalled": true,
  "HasNodeInstalled": true,
  "NodeVersion": "v18.15.0",
  "NpmVersion": "9.6.2",
  "HasTokTxInstalled": true,
  "HasMinimumToktxVersionInstalled": true,
  "RenderPipeline": "URP-HighFidelity (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset)",
  "GzipEnabled": false,
  "NeedleEngineExporterVersion": "2.67.6-pre",
  "NeedleEngineVersion": "2.67.6-pre",
  "NeedleEngineExporterPath": "Packages/com.needle.engine-exporter/package.json",
  "NeedleEnginePath": "Packages/com.needle.engine/package.json",
  "FileStats": "By Type:\r\nβ€’\t.glb β†’  x 2 = 54.7 mb\r\nβ€’\t.gltf β†’  x 2 = 0.0 mb\r\nβ€’\t.png β†’  x 17 = 51.6 mb\r\nβ€’\t<b>Total = 106.4 mb</b>\r\n----\r\nBy Directory:\r\nβ€’\tassets β†’  x 21 = 106.4 mb\r\n",
  "NeedleComponentsInScene": [
    "Needle.Engine.ExportInfo",
    "Needle.Engine.Codegen.ComponentGenerator",
    "Needle.Engine.Deployment.DeployToGlitch",
    "Needle.Engine.Components.GltfObject",
    "Needle.Engine.EditorSync.NeedleEditorSync",
    "Needle.Typescript.GeneratedComponents.MouseIncrementRotate"
  ],
  "TypeCacheIsDirty": false,
  "TypeScriptTypes": []
}

Steps to reproduce πŸ”’

1. Import the attached model to a project, on import inspector click fix all textures, drag/drop it into a Needle Unity scene, add GLTF Object component on it
2. Hit play, see the F35_v1 model in the scene with the GLTF Object component on it is the cause

Reproduction β™»

Model: https://drive.google.com/file/d/1wZS7Rw9YdREAD3JnPxyH8qXgr_kQqbx1/view?usp=share_link

Project: https://drive.google.com/file/d/1Vub06sgblEiMJO-TjOMvSzkIgQJf9hmX/view?usp=share_link

Validations 🩹

hybridherbst commented 1 year ago

Seems like some textures aren't copied along. Thanks for the report.

marwie commented 1 year ago

I think this might be the issue where UnityGLTF doesnt register the textures as dependencies and we've seen this when creating a BugReport were textures were also missing (because they were not registered as dependencies?)

ROBYER1 commented 1 year ago

I can probably find the full repro if you guys need it but the bug reporter misses those separate texture dependencies for sure which has probably affected this bug report

marwie commented 1 year ago

Hello @ROBYER1 do you still have this issue?