-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Solari fixes #21747
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
Solari fixes #21747
Changes from 6 commits
9e28dd3
0dfa417
4a7376d
d88fa9d
ae2bc85
bb9e690
81b53e0
3e56465
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,11 +18,12 @@ fn gpixel_resolve(gpixel: vec4<u32>, depth: f32, pixel_id: vec2<u32>, view_size: | |
|
|
||
| let base_rough = unpack4x8unorm(gpixel.r); | ||
| let base_color = pow(base_rough.rgb, vec3(2.2)); | ||
| let perceptual_roughness = base_rough.a; | ||
| let roughness = clamp(perceptual_roughness * perceptual_roughness, 0.001, 1.0); | ||
| // Clamp roughness to prevent NaNs | ||
| let perceptual_roughness = clamp(base_rough.a, 0.0316227766, 1.0); | ||
| let roughness = perceptual_roughness * perceptual_roughness; | ||
| let props = unpack4x8unorm(gpixel.b); | ||
| let reflectance = vec3(props.r); | ||
| let metallic = props.g; | ||
| let metallic = saturate(props.g); // TODO: Not sure why saturate is needed here to prevent NaNs | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be something wrong with our gbuffer encoding? @DGriffin91
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like any bit pattern of gpixel.b should be valid in respect to metallic. It seems sus if unpack4x8unorm is returning something that's not 0.0..=1.0
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah idk |
||
| let emissive = rgb9e5_to_vec3_(gpixel.g); | ||
| let material = ResolvedMaterial(base_color, emissive, reflectance, perceptual_roughness, roughness, metallic); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.