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

Adds multiview to CubeXr #459

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

GrantComm
Copy link
Collaborator

@GrantComm GrantComm commented Apr 29, 2024

Adds multiview into Cube_XR. This is a followup to pr#419 where multiview was added to the repo.

@GrantComm GrantComm force-pushed the cubexrmulti branch 3 times, most recently from 0a6c0f1 to a95f45a Compare April 29, 2024 17:46
projects/cube_xr/CubeXr.cpp Outdated Show resolved Hide resolved
include/ppx/application.h Outdated Show resolved Hide resolved
projects/cube_xr/CubeXr.cpp Outdated Show resolved Hide resolved
@GrantComm GrantComm force-pushed the cubexrmulti branch 3 times, most recently from fd23139 to 369de87 Compare June 24, 2024 18:24
@GrantComm GrantComm requested a review from apazylbe June 24, 2024 18:35
src/ppx/application.cpp Outdated Show resolved Hide resolved
src/ppx/application.cpp Outdated Show resolved Hide resolved
@@ -269,20 +273,29 @@ void CubeXrApp::Render()
// Update uniform buffer.
{
float t = GetElapsedSeconds();
float4x4 P = glm::perspective(glm::radians(60.0f), GetWindowAspect(), 0.001f, 10000.0f);
float4x4 V = glm::lookAt(float3(0, 0, 0), float3(0, 0, 1), float3(0, 1, 0));
float4x4 M = glm::translate(float3(0, 0, -3)) * glm::rotate(t, float3(0, 0, 1)) * glm::rotate(t, float3(0, 1, 0)) * glm::rotate(t, float3(1, 0, 0));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rework this logic a bit?

  • I am not sure if this currently works with non-XR, we have to make sure it still works
  • Can we add a GetCamera(viewIndex) and get the matrices that way, then we wouldn't have to add additional methods to the xr component

@@ -68,12 +68,12 @@ void CubeXrApp::Setup()

// Pipeline
{
std::vector<char> bytecode = LoadShader("basic/shaders", "VertexColors.vs");
std::vector<char> bytecode = LoadShader("basic/shaders", "VertexColorsMulti.vs");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you find the spec language that says the view index is going to be 0 if there is not multiview in the shader? Otherwise maybe better to use VertexColors if there is no multiview?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants