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 basic materials scene renderer proj #428

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anishmgoyal
Copy link
Collaborator

This demonstrates the scene renderer for basic materials

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>
footballhead added a commit to footballhead/bigwheels that referenced this pull request Apr 15, 2024
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.
footballhead added a commit to footballhead/bigwheels that referenced this pull request Apr 15, 2024
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.
apazylbe pushed a commit to footballhead/bigwheels that referenced this pull request Apr 17, 2024
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.
Keenuts pushed a commit that referenced this pull request Apr 17, 2024
I added an ArcballCamera to #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 #426.
@@ -0,0 +1,30 @@
# Copyright 2023 Google LLC
Copy link
Collaborator

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)
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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;
Copy link
Collaborator

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"),
Copy link
Collaborator

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"),
Copy link
Collaborator

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

Copy link
Member

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());
Copy link
Collaborator

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

Copy link
Member

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)
Copy link
Collaborator

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;
Copy link
Collaborator

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

Copy link
Member

@Keenuts Keenuts left a 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!

Comment on lines +33 to +34
settings.window.width = 1920 * 1;
settings.window.height = 1080 * 1;
Copy link
Member

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"),
Copy link
Member

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());
Copy link
Member

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants