nunuStudio icon indicating copy to clipboard operation
nunuStudio copied to clipboard

Can't get gltf texture/material in Run mode, but OK in Editor

Open j2l opened this issue 3 years ago • 15 comments

gltf object is importing just fine (blender glb export with jpg texture compressed) image But when I hit run, I get non-textured objects: image

I also tried:

  • using an internal cube and apply material
  • making a standard material using this texture
  • dragging the texture upon an internal cube
  • FBX, DAE, OBJ (no texture imported)

All failed

  • Web Version [X] 0.98.30

This one is very urgent. Thank you.

j2l avatar Mar 16 '21 14:03 j2l

Hello

Can you please provide an example file for me to test?

This is probably related with the usage of the blobs that are created to load the texture and are then discarded by the glb loader.

This makes them unusable after the loader finishes its job, they do this to prevent memory leaks.

This is certainly require some code injection into the GLTF loader.

Thanks a lot!

tentone avatar Mar 17 '21 19:03 tentone

Sure, I will. I have a even more urgent post about screenshot first :)

j2l avatar Mar 17 '21 19:03 j2l

Here's the house house.nsp.zip

j2l avatar Mar 17 '21 19:03 j2l

Reopening the scene to check, I see that the texture is empty, it wasn't saved with the nsp, so here's the gltf (glb) file to import. house.glb.zip

j2l avatar Mar 17 '21 19:03 j2l

Sorry to write on this great long week-end :) Would you please have a look on this one? I'd need it to build a scene. Thanks!

j2l avatar Apr 04 '21 11:04 j2l

Hello, Hope you have time fr this one, I tried all I can to make it work on my own. No luck so far.

j2l avatar Apr 06 '21 09:04 j2l

see above @tentone :) thanks :smile:

j2l avatar Apr 06 '21 09:04 j2l

Hello @tentone , Can you please tell me if you know another way to import & apply texture on imported mesh with UV map? Thank you very much

j2l avatar Apr 07 '21 11:04 j2l

OK, I guess it's way too hard to fix. I'll find another way.

j2l avatar Apr 07 '21 11:04 j2l

Hello Well this one is pretty much impossible for me to fix because the blob is discarded after the GLTF loader uploads data to the texture. It would required some sort of code injection into the GLTF loader.

Thi might be achievable with some sorte of witchery using webpack loaders but it will be quite tricky. The best solution would be to convert the file into another format.

tentone avatar Apr 07 '21 12:04 tentone

Thank you @tentone I don't understand how it is perfectly working in the editor then. Why does only the run mode discard the texture? Ah well, I don't get all of this for now :)

j2l avatar Apr 07 '21 13:04 j2l

Hello, i know it's been a long time since you opened the issue, but did you find a solution for this ?

difool95 avatar Sep 12 '22 20:09 difool95

Nope, project, looks like is abandoned unfortunately.

j2l avatar Sep 13 '22 05:09 j2l

Hello

I havent found much time to maintain the project.

Currently the project is pretty much stuck it would require a lot of work since three.js has moved into modules and the entire object system would need to be revised.

tentone avatar Sep 17 '22 13:09 tentone

I understand @tentone . It's a crossroad: capitalize on this great project (1700 stars!) and redo it from scratch or archive it. Depending on your long term plan. Please let us know. Your approach with JSON scenes, integrated code editor and effects is great! If I could, I would start something like this with svelte but I'm more an artist than a coder.

j2l avatar Sep 17 '22 16:09 j2l

Hello How do I fix this bug? @tentone @j2l

zhaoran112 avatar Feb 23 '24 15:02 zhaoran112

2022, no fix. Good luck

j2l avatar Feb 23 '24 17:02 j2l