PBR Specular missing #608
Replies: 9 comments
-
Hi Roland, I merged a PR to vsgXchange a couple of days ago that broke the assignment of the VSG_WORKFLOW_SPECGLOSS define in vsgXchange master. I have now fixed this with vsgXchange commit: 02f5bca9778976f6c67f97c4c69988ee66af7434. However, while this fixes the problem with VSG_WORKFLOW_SPECGLOSS not being used it doesn't look to affect the rendering of the SpecularTest.glb model. I've converted the file to .vsgt using vsgconv and the VSG_WORKFLOW_SPECGLOSS define appears where I would expect it to. I think there must be something else amiss in either the shaders or in vsgXchange::Assimp. As to what I can't say at this point. While I've refactored them I'm not the original author of the shaders and assimp plugin so not familiar with 100% of the code/shaders/assimp, so will need to step through each part slowly to figure what the shaders/loader code should look like. What would be useful is a 3rd party tool that can show us exactly what these models should look like, can anyone recommend such a tool? Cheers, |
Beta Was this translation helpful? Give feedback.
-
I have created an Issue ticket for this problem: #609 |
Beta Was this translation helpful? Give feedback.
-
A quick search for a GLTF reference viewer and I've come across: |
Beta Was this translation helpful? Give feedback.
-
Looking at the SpecularTest model in the Khronos glTF-Sample-Viewer-Release it looks to rely upon an environment map to generate the gloss effect, if you disable this then the spheres are black like the vsgviewer rendered version. I see secular highlights on other models so I think the issue on this one is related to models that rely upon reflecting an environment texture. The VSG doesn't provide a default one like the glTF-Sample-Viewer-Release viewer is doing, and it's not something I have attempted to implement yet. I'm now inclined to tag this as a missing feature that we need to implement for VSG-1.2 rather than a bug. |
Beta Was this translation helpful? Give feedback.
-
I'm actually looking at this code in assimp.cpp right now. In fact there's a bug that is forcing the specular glossiness workflow for all gltf materials. It's good to know that specular / glossiness is broken, because I was trying to figure out what I broke! Stay tuned for a pull request. |
Beta Was this translation helpful? Give feedback.
-
Thanks, Robert. That's a very useful viewer!
Cheers,
Roland
…On Fri, 25 Nov 2022 at 22:13, Robert Osfield ***@***.***> wrote:
A quick search for a GLTF reference viewer and I've come across:
https://github.khronos.org/glTF-Sample-Viewer-Release/
—
Reply to this email directly, view it on GitHub
<#608 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOEQ6ATGU275QEWBATXFLWKCNPDANCNFSM6AAAAAASLC7VJU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into this Robert and Tim. Just for context, I'm looking at loading external models, often DXF, with geometry but little to no material or lighting information. When you load them using vsgXchange they just come out white, but shaded using the diffuseFactor. I'm trying to give the user the ability to modify the PBR material properties to colour the objects to their desire. Regards, |
Beta Was this translation helpful? Give feedback.
-
HI Rolamnd,
On Sun, 27 Nov 2022 at 22:31, Roland Hill ***@***.***> wrote:
Just for context, I'm looking at loading external models, often DXF, with
geometry but little to no material or lighting information. When you load
them using vsgXchange they just come out white, but shaded using the
diffuseFactor. I'm trying to give the user the ability to modify the PBR
material properties to colour the objects to their desire
I can imagine others will want to do similar things, would make a nice
example for vsgExamples.
I expect ImGui has a colour chooser so perhaps one could write an ImGui/VSG
example for moidifying vertex or material colours.
I'll have to learn ImGui properly before I can embark on such a task,
others are welcome to take up the challenge :-)
Cheers,
Robert.
… Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Hi Robert, I'll see what I can put together once I've got it all working properly. Just confirming that I can see changes with the FlightHelmet model when modifying the roughness & metallic factors and the specular spot moves with the light. Thanks, again. Cheers, |
Beta Was this translation helpful? Give feedback.
-
Hi Robert,
I think the specular code path, as defined by VSG_WORKFLOW_SPECGLOSS, might be missing from the PBR fragment shaders.
Try vsgviewer glTF-Sample-Models/2.0/SpecularTest/glTF-Binary/SpecularTest.glb
Here the spheres render as flat black circles rather than the spherical objects in the screen shots supplied in the glTF directories.
I find the same in my own code where I can modify the diffuseFactor and emissiveFactor of the PbrMaterialValue of a loaded model and see the changes reflected on screen. Modifying specularFactor, metalFactor and roughnessFactor appear to do nothing.
I've traced through vsgXchange while loading the models and can see that hasPbrSpecularGlossiness is true and that VSG_WORKFLOW_SPECGLOSS gets defined. It just doesn't appear to be reflected in the final frag shader.
I've read the discussion that you pointed me to, but I'm not feeling overly confident in my understanding yet, so see what you think from the example above.
Regards,
Roland
Beta Was this translation helpful? Give feedback.
All reactions