Closed shrekshao closed 1 year ago
Hi shrekshao,
thanks for the build failure fix and update in the Readme.md :)
With best regards, Sam
Hi shrekshao,
when testing the examples you will probably notice I ported your deferred rendering example to native:
./wgpu_sample_launcher -s deferred_rendering
The result does not completely match the JavaScript version from the WebGPU Samples: de gray background hides the ground plane.
the gBuffer view looks fine:
I could not find the reason of the difference with the JavaScript version. Do you have any ideas or suggestions to try out to resolve the issue ?
Thanks and best regards, Sam
I believe the reason is at https://github.com/samdauwe/webgpu-native-examples/blob/master/src/examples/deferred_rendering.c#L770-L772
The clearValue for position GBuffer should be something like
.r = FLT_MAX,
.g = FLT_MAX,
.b = FLT_MAX,
.a = 1.0f,
cuz for areas with no rasterized fragments, we should have a way to differentiate them in the Gbuffers. In the fragmentDeferredRendering.wgsl
there's
if (position.z > 10000.0) {
discard;
}
to early return.
But I just tried locally that still didn't fix the issue. Maybe I should find another time to further look at it.
Feature Depth Clamp is removed in dawn. Require Depth Clip Control instead. https://dawn.googlesource.com/dawn/+/8d73198aca5f1a83283068298c9bfd79640ca36b
This unblocks the build failure on my local linux machine. (with dawn header at f8c07d4753a32b62b52ba86e8ae0dba4830063b3)
Update Readme.md for the running examples cmd line as well (with -s now)