Closed Nolram12345 closed 1 year ago
Here is another white furnace example with the tree model illustrating the issue. https://github.com/turanszkij/WickedEngine/assets/37701550/f8d5de59-0e4b-4ff6-919b-b5cf7857c24c
Right now it mostly matches Windows 3D Viewer result
Windows 10 3D Viewer:
Wicked Engine:
(I had to remove vertex colors from the model, otherwise it's mostly balck)
I'm having problems with Blender, I couldn't really find a way to adjust roughness easily. But I agree that Blender renders it differently, as if it doesn't have fresnel effect.
Gestaltor reference GLTF viewer:
Wicked Engine:
I think it's pretty close.
Seems like a plain Schlick is being used for IBL reflection, instead of DFG term. https://github.com/turanszkij/WickedEngine/blob/19280fc45e868bebde31489684457e3e2266ecea/WickedEngine/shaders/surfaceHF.hlsli#L244
I suggest to bake DFG lookup table for IBL, or use approximations (ie. https://www.unrealengine.com/en-US/blog/physically-based-shading-on-mobile).
Right now it mostly matches Windows 3D Viewer result
Windows 10 3D Viewer:
Wicked Engine:
(I had to remove vertex colors from the model, otherwise it's mostly balck)
I see that, however the visual output here is definitely wrong. A bark material with those rough properties should have that metallic sheen. Therefore I would say that the PBR model in the windows 3D viewer is probably flawed as well (which isn't terribly surprising considering its a very basic viewer that isn't designed for accuracy or production rendering). I therefore think taking orientation against both other renderers who don't exude this behaviour and real-life reference is probably better.
LVutner may be onto something with the usage of Schlick for IBL reflection.
I'm having problems with Blender, I couldn't really find a way to adjust roughness easily. But I agree that Blender renders it differently, as if it doesn't have fresnel effect.
The model has a roughness map, if you go on the material settings, and click on the dot at roughness ("separate color") you can then choose "remove link" in the menu. After that you can modify the roughness value globally. Wicked and Blender are close for low values, but begin to differ after 0.4 or so.
Seems like a plain Schlick is being used for IBL reflection, instead of DFG term.
I suggest to bake DFG lookup table for IBL, or use approximations (ie. https://www.unrealengine.com/en-US/blog/physically-based-shading-on-mobile).
After replacing the Schlick with the EnvBRDFApprox
in the article you linked:
Wicked Roughness 1:
Blender roughness 1:
Wicked Rougness 0:
Blender roughness 0:
Cool. The minor differences comes from DFG itself.
That looks a lot better! Can't wait to try it and see if it improves things :)
Added this in the PR: https://github.com/turanszkij/WickedEngine/pull/737 Let me know if this is matching expectations.
The following fixes were made since this issue was opened:
EXT_lights_image_based
GLTF sample
There seems to be some incorrect rendering of rough materials in WickedEngine. Continuing from the discussions on the Discord, rough materials are still rendered with specularity, resulting in incorrect lighting them, which is noticeable especially when validating against other renderers. See footage below, where I compare rendering of this tree 3D model in this HDRI in WI vs Blender (Cycles and Eevee), and also a comparison of a simple fully black cube. It's probably worth a further investigation.
https://github.com/turanszkij/WickedEngine/assets/37701550/71a915f6-0121-4de2-8672-392bab1cbeb2
https://github.com/turanszkij/WickedEngine/assets/37701550/c6ab8452-a18d-4ee6-824e-c2c3e68531fa
https://github.com/turanszkij/WickedEngine/assets/37701550/52581f49-f951-4dae-9b38-178f3adf5247