donmccurdy / three-gltf-viewer

Drag-and-drop preview for glTF 2.0 models in WebGL using three.js.
https://gltf-viewer.donmccurdy.com/
MIT License
2.13k stars 537 forks source link

support for "KHR_materials_clearcoat", "KHR_materials_transmission", "KHR_materials_sheen" #233

Closed rawwerks closed 3 years ago

rawwerks commented 3 years ago

i love this resource. it would fantastic if it were updated to support the 3 new PBR extensions (https://gfxspeak.com/2020/12/03/physically-rendering-extensions/)

image

Left is is https://gltf-viewer.donmccurdy.com/ , right is https://sandbox.babylonjs.com/.

Thank you!

donmccurdy commented 3 years ago

Hi! I believe KHR_materials_clearcoat is already supported (let me know if you have trouble with it!), but you're correct that the others are not yet. This viewer depends on three.js for rendering, and so three.js would need to add support for these extensions first. If you'd be interested in leaving an upvote or comment there, I believe that https://github.com/mrdoob/three.js/issues/16977 is the relevant issue.

cx20 commented 3 years ago

BTW, I think three.js r131 supports KHR_materials_transmission.

donmccurdy commented 3 years ago

Just updated to r131 – should include transmission, volume, and IOR if I'm not mistaken. Sheen is still not really supported, but I'll close out this issue for now since there hasn't been movement on that in three.js for a while.

Screen Shot 2021-08-07 at 9 35 51 AM
cx20 commented 3 years ago

Thank you for updating to the latest version. However, when I tried it, it seems that there is an error in the console. https://gltf-viewer.donmccurdy.com/

app.js:1 
Uncaught SyntaxError: Cannot use import statement outside a module

Is it a problem with my environment? Environment: Windows 10 + Chrome 92

donmccurdy commented 3 years ago

Ah, thanks! Should be fixed now.

cx20 commented 3 years ago

Thank you for the quick fix. I think it's okay now. glTF Viewer + Duck.gltf(use Transmission extension) result: image