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

GLB materials not importing correctly #1198

Closed
NoofleBot opened this issue Sep 24, 2024 · 9 comments
Closed

GLB materials not importing correctly #1198

NoofleBot opened this issue Sep 24, 2024 · 9 comments

Comments

@NoofleBot
Copy link

TL;DR The editor is not importing my .glb file with correct material data like the viewer does
Bug Example Photo

  • I have tried both Firefox 130.0.1 (64-bit) and Brave 1.70.117 (Chromium: 129.0.6668.59) 64-bit, neither work

I'm providing my blender file aswell as my exported GLB file and a 360 photo for your reference/ease of replication
My GLB, Blender File, & 360 Photo.zip

Steps to Reproduce for Editor

  1. Open the blender file with Blender v4.2.1 LTS and select all objects in the scene collection
  2. Go to File > Export > glTF 2.0 (.glb/.gltf)
  3. On the export screen ensure format is set to glTF Binary (.glb)
  4. Ensure nothing is selected in the "Include" tab
  5. Ensure under the "Transform" tab that +Y Up is selected
  6. The rest of the settings should look like this:
    the rest of the settings
  7. Name the .glb file and Export it to a path you can remember
  8. Open https://playcanvas.com/editor in your WebGL 2.0 compatible browser of choice
  9. If you are not signed into playcanvas, sign in now
  10. Create a new blank project
  11. Import the .glb file into the assets manager
  12. Import the 360 photo into the assets manager
  13. Right click the 360 photo and turn it into a cubemap
  14. Drag and drop the generated cubemap onto the scene
  15. Drag and drop the template of the .glb file you imported earlier
  16. You can now see the issue.

Steps to Reproduce for Viewer

  1. Open https://playcanvas.com/viewer in your WebGL 2.0 compatible browser of choice
  2. Import the .glb file into the viewer
  3. Notice the material data for imported correctly reflecting the roughness data and other material characteristics (ignore the glass material from blender, the metal material is the focus of this issue)
@slimbuck
Copy link
Member

Hi @NoofleBot, could you please attach the blender glb file?

@yaustar yaustar changed the title GLB import pipeline is broken GLB materials not importing correctly Sep 24, 2024
@yaustar
Copy link
Collaborator

yaustar commented Sep 24, 2024

@slimbuck the GLB is in the zip

@slimbuck
Copy link
Member

Ah great thanks. I suspect this file probably the uses depreciated material extension that we didn't add support for, but I'll investigate!

@slimbuck
Copy link
Member

(KHR_materials_pbrSpecularGlossiness)

@slimbuck
Copy link
Member

It looks like the text mesh and center spike mesh should be rendering with diffuse white material, but are being rendered as reflective silver after import. Can I confirm this is the issue you're reporting @NoofleBot?

The two gltf materials in question ("Text Glow" and "Text Glow.002") are completely default, which indicates we are not using correct defaults on import.

@slimbuck
Copy link
Member

I found the issue. Our default Glossiness value is wrong in some cases. The fix will be released in the next few days.

To fix the materials in the scene above, set 'Text Glow' and 'Text Glow.002' glossiness to 100.

@NoofleBot
Copy link
Author

The issue isn't the "Text Glow" and "Text Glow.002" materials, I don't really mind whatever is broken with those. My issue is that for whatever reason the main material "Material" doesn't import with the correct material properties to reproduce the metal look that is seen in the PlayCanvas viewer. I just want the model in the PlayCanvas Editor to import and look exactly like the model PlayCanvas viewer, given they are being imported from the same .glb file it doesn't make sense that they render differently.

@slimbuck
Copy link
Member

Oh right I didn't notice thr difference there, but will investigate.

@slimbuck
Copy link
Member

Hi @NoofleBot,

Oh I just realised what the problem is you've been referring to. You're saying that the reflections are sharp when they should be blurry.

The reason for that is you must generate "prefiltered lighting data" on your cubemap. Without this the engine can't render blurry reflections:

Screenshot 2024-09-25 at 09 24 35 Screenshot 2024-09-25 at 09 24 42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants