-
Notifications
You must be signed in to change notification settings - Fork 34
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 basic materials scene renderer proj #428
base: main
Are you sure you want to change the base?
Conversation
This demonstrates the scene renderer for basic materials Co-authored-by: Hai Nguyen <chaoticbob@users.noreply.github.com> Co-authored-by: Aliya Pazylbekova <apazylbe@users.noreply.github.com>
I added an ArcballCamera to google#428 and noticed that it wasn't working as expected. ArcballCamera wasn't updating mViewProjectionMatrix after modifying mViewMatrix. This was causing the ArcballCamera to not work correctly when combined with the classes introduced in google#426.
I added an ArcballCamera to google#428 and noticed that it wasn't working as expected. ArcballCamera wasn't updating mViewProjectionMatrix after modifying mViewMatrix. This was causing the ArcballCamera to not work correctly when combined with the classes introduced in google#426.
I added an ArcballCamera to google#428 and noticed that it wasn't working as expected. ArcballCamera wasn't updating mViewProjectionMatrix after modifying mViewMatrix. This was causing the ArcballCamera to not work correctly when combined with the classes introduced in google#426.
@@ -0,0 +1,30 @@ | |||
# Copyright 2023 Google LLC |
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.
2024
# limitations under the License. | ||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR) | ||
|
||
project(31_gltf_basic_materials) |
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.
I think we can remove 31_
@@ -0,0 +1,339 @@ | |||
// Copyright 2023 Google LLC |
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.
2024
@@ -0,0 +1,17 @@ | |||
// Copyright 2023 Google LLC |
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.
2024
settings.appName = "gltf_basic_materials"; | ||
settings.enableImGui = true; | ||
settings.grfx.api = kApi; | ||
settings.grfx.enableDebug = true; |
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.
I think we should just remove this line and rely on the default behaviour
// | ||
PPX_CHECKED_CALL(scene::GltfLoader::Create( | ||
GetAssetPath("scene_renderer/scenes/tests/gltf_test_basic_materials.glb"), | ||
// GetAssetPath("scene_renderer/scenes/tests/gltf_test_materials.gltf"), |
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.
We should probably remove this line
PPX_CHECKED_CALL(grfx_util::CreateIBLTexturesFromFile( | ||
GetDevice()->GetGraphicsQueue(), | ||
GetAssetPath("poly_haven/ibl/old_depot_4k.ibl"), | ||
// GetAssetPath("poly_haven/ibl/abandoned_workshop_02_4k.ibl"), |
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.
Should probably remove this line
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.
And remove the new assets since they seem to be unused.
PPX_CHECKED_CALL(frame.imageAcquiredFence->WaitAndReset()); | ||
|
||
// Wait for and reset render complete fence | ||
PPX_CHECKED_CALL(frame.renderCompleteFence->WaitAndReset()); |
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.
Wait on renderCompleteFence before AcquireNextImage, see #445
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.
Question: Is the wait for imageAcquiredFence() required here?
Could we do:
- renderCompleteFence.WaitAndReset()
- acquireNextImage(imageAcquiredSemaphore)
- graphics.Submit(wait=imageAcquiredSemaphore, signal=renderCompleteSemaphore + fence)
- present(wait=renderCompleteSemaphore)
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.
@Keenuts There was a thread on this in our chat last November, where someone mentioned acquireNextImage return with invalid index, I am not sure how though.
: public ppx::Application | ||
{ | ||
public: | ||
virtual void Config(ppx::ApplicationSettings& settings) override; |
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.
nit: virtual is implied by override and can be removed
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.
Thanks for the PR!
settings.window.width = 1920 * 1; | ||
settings.window.height = 1080 * 1; |
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.
why * 1
? Might be removed. (Might also keep the default value?)
PPX_CHECKED_CALL(grfx_util::CreateIBLTexturesFromFile( | ||
GetDevice()->GetGraphicsQueue(), | ||
GetAssetPath("poly_haven/ibl/old_depot_4k.ibl"), | ||
// GetAssetPath("poly_haven/ibl/abandoned_workshop_02_4k.ibl"), |
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.
And remove the new assets since they seem to be unused.
PPX_CHECKED_CALL(frame.imageAcquiredFence->WaitAndReset()); | ||
|
||
// Wait for and reset render complete fence | ||
PPX_CHECKED_CALL(frame.renderCompleteFence->WaitAndReset()); |
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.
Question: Is the wait for imageAcquiredFence() required here?
Could we do:
- renderCompleteFence.WaitAndReset()
- acquireNextImage(imageAcquiredSemaphore)
- graphics.Submit(wait=imageAcquiredSemaphore, signal=renderCompleteSemaphore + fence)
- present(wait=renderCompleteSemaphore)
This demonstrates the scene renderer for basic materials