Skip to content
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

Add three-gpu-pathtracer to Fidelity Tests #3496

Merged
merged 18 commits into from
Jan 5, 2023

Conversation

gkjohnson
Copy link
Contributor

@gkjohnson gkjohnson commented May 25, 2022

Reference Issue

--

Hello! I'm the developer of the three-gpu-pathtracer project (a generalized path tracer library built on top of three.js) and have added support for it to the "render-fidelity-tools" package to help find problems with the implementation. The project is still fairly new so there are issues with a number of models and some but it's great to see where it's failing and which glTF parameters are not properly supported, yet.

Also I see now that you'd like an issue for each PR - I'm happy to make one now if you guys would like. And if this looks acceptable then I can make whatever other changes are needed / generate images! Thanks for the awesome project!

Here are some of the screenshots including cases where it's clearly not behaving correctly:

cc @bhouston

@bhouston
Copy link
Contributor

bhouston commented May 26, 2022

This is great work @gkjohnson! I think it would be great to have this merged into the core ModelViewer test suite so that progress on filling out the rest of the glTF material model can be tracked accurately.

A quick skim suggests that these glTF extensions to the material model are not yet supported:

@elalish
Copy link
Collaborator

elalish commented Jun 6, 2022

Thanks, this is fantastic! Sorry I didn't get back to you sooner; this came in just as I caught COVID and I was out for awhile. Even if some of the renders aren't perfect, can you please add the golden images? This will allow us to show your current results publicly. Of course you can also set exclude in the config on any scenarios that are known to be not supported, or cause a crash/hang.

@gkjohnson
Copy link
Contributor Author

Thanks @elalish! I've just updated the goldens with a few tests excluded (khronos-sponza, LDR Metal Rough Spheres, and khronos-boxInterleaved). I'll plan to look into the issues with sponza box interleaved at some point but I don't think I'll plan to support LDR jpg environment maps. I've only set the renders to 100 samples at the moment to save on render time but maybe I'll bump that up in a future update.

As mentioned above there are still quite a few issues that will make the three-gpu-pathtracer images stick out quite a bit but I think it's a good first step to getting these problems addressed!

@elalish
Copy link
Collaborator

elalish commented Jun 13, 2022

Thanks! Before we merge this, I'd like to ensure the render setup is correct, which means at least some of the simple objects should match pretty closely. Many of the objects look dark (beyond just our lack of proper ambient occlusion), for instance the simple triangle. That indicates to me that the tone mapping or exposure may not be matched yet.

Also, I'd recommend excluding any scenarios that are obviously wrong (like the antique camera that is somehow grayscale?). We tend to think of path tracers as better than rasterizers, so I don't want people thinking that is our baseline :). We can look at the list of excluded scenes as a TODO list.

@gkjohnson
Copy link
Contributor Author

Great - this is good feedback. When I have a little time I'll go through and mark the obviously incorrect ones and add them over time as the renderer improves. The project is still fairly new so part of this effort is finding where the result is meaningfully different from other renders so we can improve the fidelity of three pathtracer (including things like being too dark in some cases). Definitely understand that the intent of the project is to measure the correctness model-viewer, though.

# Conflicts:
#	packages/render-fidelity-tools/package-lock.json
#	packages/render-fidelity-tools/package.json
#	packages/render-fidelity-tools/test/config.json
@gkjohnson
Copy link
Contributor Author

Hey @elalish! I've made quite a few fixes and releases over the last several months that have made significant improvements to the fidelity of the examples. You can see the current state of the screenshots here:

https://gkjohnson.github.io/three-gpu-pathtracer/example/bundle/screenshotList.html#model-viewer

There are still some improvements to make specifically to rough metallic materials but there will always be room for improvement. Do you have any further thoughts now on including three-gpu-pathtracer into the fidelity tests? If you're open to it I can update the PR to the latest version.

@elalish
Copy link
Collaborator

elalish commented Jan 3, 2023

Incredible progress! Yes, I would love to see these included in our fidelity tests. As long as you can commit to updating them here semi-regularly, please go ahead and add them. Hopefully this benefits your process too.

@bhouston
Copy link
Contributor

bhouston commented Jan 3, 2023

Amazing work @gkjohnson! BTW something is weird when I first load the comparison page. It says it is comparing to dspbr-pt, but it is actually comparing to filament. That confused the heck out of me initially.

@hybridherbst
Copy link
Contributor

This is so cool to see :) great progress!

@gkjohnson
Copy link
Contributor Author

gkjohnson commented Jan 4, 2023

Thanks guys! I've just updated the PR with the latest version of the path tracer, new screenshots, and updated exemptions for the config.

I noticed some issues with handling of clearcoat maps and env maps which will be fixed in the next release - so I'll be able to remove some of the excluded screenshots then. Some of the other excluded screenshots include the dark triangles which are a result of the lack of multibounce-accommodation noticeable in rough metal materials (see furnace test), some specular transparent materials with noticeable fireflies, and demos with features that aren't supported (unlit, LDR env map, etc).

@elalish let me know if there's anything else I can do to get this merged!

@gkjohnson
Copy link
Contributor Author

Oh also @bhouston

BTW something is weird when I first load the comparison page. It says it is comparing to dspbr-pt, but it is actually comparing to filament. That confused the heck out of me initially.

Good point - I just pushed a fix for this. It defaults to comparing to model-viewer but it takes a second for the JS to update the dropdown. I've adjusted the page to hide the UI until the JS has been able to run.

@bhouston
Copy link
Contributor

bhouston commented Jan 4, 2023

Good point - I just pushed a fix for this. It defaults to comparing to model-viewer but it takes a second for the JS to update the dropdown. I've adjusted the page to hide the UI until the JS has been able to run.

It appears to be a Safari only bug and it remains. I can not reproduce in Chrome.

@gkjohnson
Copy link
Contributor Author

It appears to be a Safari only bug and it remains. I can not reproduce in Chrome.

Looks like I used a non-standard method for changing the dropdown. It should (hopefully) be fixed now.

Copy link
Collaborator

@elalish elalish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, amazing work on your path tracer! I look forward to seeing updates and watching the improvement. Also, I believe more models have been added to the sample repo. If you'd like to help us keep up by adding them to our config, I'd be very grateful!

@elalish elalish merged commit 733abd2 into google:master Jan 5, 2023
@gkjohnson gkjohnson deleted the three-gpu-pathtracer-viewer branch January 5, 2023 23:53
@gkjohnson
Copy link
Contributor Author

Great thanks @elalish! Maybe I'll take a look at some of the other sample models when I get a chance.

JL-Vidinoti pushed a commit to vidinoti/model-viewer that referenced this pull request Apr 22, 2024
* Add three-gpu-pathtracer viewer

* Add dependencies, fix module declaration

* fix title

* Update packages, config

* Add screenshots

* remove sponza golden

* Improve render to avoid floating point precision issues

* Update the pathtracer viewer

* Add three-gpu-pathtracer renderer option

* Improve renderer

* remove old screenshots

* Add config excludes

* reduce tile count

* Add screenshots

* Add directional light screenshot, update to v0.0.10

* Add support tangent generation, clearcoat test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants