-
Notifications
You must be signed in to change notification settings - Fork 434
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
--[PBR part 3 of 3]Map KHR Extensions to PBRDrawables and Implement in Shader #2091
Conversation
Tests may need to be added to test extension performance. (I.E clearcoat, specular texture, etc) |
82dcc7e
to
6fbffd6
Compare
be3f571
to
90ca688
Compare
548e5ef
to
ca31098
Compare
454e5ff
to
ba4746a
Compare
1e57af3
to
805e938
Compare
790cc13
to
654f9ea
Compare
654f9ea
to
9d5620c
Compare
Organize shader code into separate files based on function.
…onditionally reset matCache
8ec0dcf
to
93bd93d
Compare
…at layer support is present)
dbc960e
to
a928fb3
Compare
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.
Didn't go through the actual shader algorithms, but the GLSL code itself looks alright.
362ec2e
to
cdfd241
Compare
Consistent flag comparison using subset.
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.
LGTM, great step toward better rendering. 👍
This is to provide the user a single field by which they can tweak how bright or dark their scene is without having to reauthor their lighting configs.
Configuration-controllable color remapping.
Motivation and Context
This PR
will introduce some limited support in our existingrewrites our PBR shader and extends it to support Khronos-specified materials layers (ior, specular textures, clearcoat, anisotropy) byTangent-space TBN frame derivation is also supported when precomputed tangents are not provided, which enables the use of normal textures.
Extensions supported so far :
KHR_materials_ior : instead of using a hardcoded DielectricSpecular of 0.04 (which assumes a material IOR of 1.5), we are using material-provided IOR (if exists) to derive the DielectricSpecular. This mainly served as proof of concept and pipeline test.
https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_ior
KHR_materials_specular : The values in this extension consist of float and texture strength and color and texture specular colors. These are used to modify the fresnel specular normal incidence and glancing incidence terms.
https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_specular
KHR_materials_clearcoat : The values in this extension consist of a float and texture strength, a 3-vector and texture color and a texture-based normal. Currently the normal support is incomplete (it uses base normal), but otherwise clearcoat is supported.
https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat
Generating tangents for normal textures, clearcoat normal textures and anisotropy when precomputed tangents are not provided. Using a partial derivative calculation in the fragment shader on both position and texture coordinates, the ability to generate tangent-space TBN frame was added. This follows the concept given here https://jcgt.org/published/0009/03/04/paper.pdf Section 3.3.
KHR_materials_anisotropy : The values in this extension consist of a strength value, a direction in tangent-space, and potentially a texture. These are used to give a directional bias to the specular calculation.
https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_anisotropy
Comparison Before and After videos of PBR changes using a Floorplanner scene
A few things to note :
Below is the current state of the PBR shader:
oldPBR102817140.mp4
And here is an example of the same scene with this PR's updated PBR shader computations
newPBR102817140.mp4
A few improvements to notice :
New PBR with IBL
Here's that same scene lit with both the current default lights on main and the current IBL setup on main, weighted equally 50/50.
newPBR_IBL102817140.mp4
How Has This Been Tested
Existing c++ and python tests pass, with new test images where appropriate.
Types of changes
Checklist