-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[WIP] PBR Materials extension #643
Conversation
Fix title
# Conflicts: # extensions/Vendor/WEB3D_materials_pbr/Appendix.md
@erich666 would you or any of your colleagues be interested in reviewing this proposed PBR materials extension to glTF? |
|
||
## Dependencies | ||
|
||
Written against the glTF 1.0 spec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want this to be using the 1.0.1 spec, which may require no changes to the extension. We plan to finish 1.0.1 for SIGGRAPH. See #605.
|
||
| Property | Type | Range | Default Value | Description | | ||
|:------------:|:----:|:-----:|:-:|:-----:|:-----------:| | ||
| `diffuseFactor` | `FLOAT_VEC4` | [0, 1] for all components | [1,1,1,1] | The RGB components of the reflected diffuse color of the material. For raw metals the diffuse color is black (0.0). The fourth component (A) is the `opacity` of the material. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have experience with PBR materials, but I just want to confirm that it is common to use the alpha channel of the diffuse factor for opacity.
Add energy conservation to spec gloss model
One of my students, @jian-ru, added support for the current version of this extension to his Vulkan engine: https://github.com/jian-ru/laugh_engine#gltf-support |
Also WIP WebGL glTF PBR reference implementation (raw WebGL, no engine) by @moneimne is here: http://www.seas.upenn.edu/~moneimne/WebGL-PBR/ |
From #817
Is there any material schema example that shows the diff between a metal-roughness material vs a specular-glossiness one ? It seems to be a small change regarding the schema but as I am working on an exporter using PBR, I would like to be sure that it's done well. From what I understand, only the specular-glossiness material description would be under an |
Three points coming to my mind right now:
The last point will take some more days, but the first two points can be done relatively quickly. @bghgary Would it be possible for you and your colleague (Sebastien, I believe) to specify the prioritization of the different maps as we discussed it and open a PR for that? |
If there is anything @moneimne can do to help finish the spec/extension, please let us know. |
Yes, though for the PR, I would expect this information to go with the separate document for additional maps that you mentioned. I can wait until you are done or you can just incorporate this into your document directly. List of additional maps in priority order:
Resource-bound implementations should drop maps from the bottom to the top. |
Yes, I'll provide that one. Please feel free to open the PR and already incorporate the table into the spec right now. |
@selim-bekkar-sb mentioned in #643 (comment)
The answer by @pjcozzi in #643 (comment) was:
Is it safe to assume that combining these textures will be enforced? I'm asking because, for example, the "Helmet" test model and the work in https://github.com/moneimne/WebGL-PBR in general seem to operate on separate textures. I'd like to create a "baseline" version (not an "official reference" - only for personal use - but to be published at https://github.com/javagl/gltfTestModels/tree/master/DamagedHelmetModified ), and now assume that I'd create a combined version of the respective textures. |
Yes, and also agreed with the comment of @pjcozzi Imagine we would allow both, we would have the risk that each combination "exporter/renderer" implements only one of the possible ways, which would lead to assets not being fully interchangeable across engines @moneimne |
So then I hope that https://github.com/javagl/gltfTestModels/blob/master/DamagedHelmetModified/glTF/Default_MetalSmooth_metallicRoughness.jpg can serve as a basis for further tests. |
Yes, I have been using the Helmet test model as is for now, but I can definitely use the combined version of the model once the changes have been made. Thank you for the combined texture, @javagl! Do you also plan on updating the glTF file to reflect this change? |
Sure. I just started working on all that, and intended to create a shader implementation that implements the spec as closely as possible. I started reading the Frostbite PBR document, but it's difficult to flesh out the relevant parts here. E.g. the spec does not cover normals/bump maps or ambient occulsion, and I still have to figure out how they are integrated eventually (there are some open issues for the discussion about these points). In the meantime, I have updated the glTF and did some minor updates to the shaders, to use the combined metallic+roughness texture, and to take the factors (base color, metallic, roughness) into account: javagl/gltfTestModels@6682793 |
Metal Roughness is being added to the core glTF 2.0 spec in #830. |
@pjcozzi can we have a succinct recap of the logic behind putting specular-glossiness into an extensions? @cedricpinson how does the decision relate to Sketchfab's PBR model out of curiosity? |
@tparisi this was discussed at length with broad community input, see #696 (comment) |
@tparisi well nothing special we adapted our implementation to fit the extension. I would have been happy to have this in the core, but it does not really change a lot. I understand that simplicity with metalness,roughness is good for everybody. |
Should we close this PR, or it will be published as glTF 1.0 extension? |
I think we could close it. @pjcozzi What is your opinion? |
OK with me. If there are any TODOs in comments, please capture them in a separate issue. |
This is our (currently WIP) PBR material extension - this PR is currently mainly intended to serve as a place for discussion.
Direct Preview:
https://github.com/tsturm/glTF/tree/master/extensions/Vendor/FRAUNHOFER_materials_pbr