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 a variable rate shading demo #852

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 23, 2023

This project showcases how to use variable rate shading (VRS) in 3D to improve performance.

Performance metrics are also displayed to evaluate potential performance gains.

Once this PR is merged, we can link to the demo in the documentation 🙂

Preview

variable_rate_shading webp

@Calinou Calinou force-pushed the add-variable-rate-shading-demo branch from c5413d9 to 57f3e70 Compare February 26, 2023 22:17
@akien-mga akien-mga changed the base branch from 4.0-dev to master February 28, 2023 17:40
@fire
Copy link
Member

fire commented Mar 10, 2023

Will be testing this today.

get_viewport().use_xr = true
xr_camera.current = true

# Reposition our origin point to work around an engine bug.
Copy link
Member

Choose a reason for hiding this comment

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

Is this bug still active?

Copy link
Member Author

@Calinou Calinou Mar 22, 2023

Choose a reason for hiding this comment

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

I commented out the line and the bug occurred in 4.0.stable, so yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, weird, I was under the impression that was fixed. I might need to have another look at that :)

texture_rect.texture = texture
texture_rect.visible = true
elif vrs_mode == Viewport.VRS_XR:
# Doesn't seem to be supported yet. This should be exposed in a future engine version.
Copy link
Member

Choose a reason for hiding this comment

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

Is this still a problem?

Copy link
Member Author

Choose a reason for hiding this comment

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

To my knowledge, yes.

cc @BastiaanOlij

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is just a matter of binding get_vrs_texture in XRInterface so we have access to it.

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

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

I think there is room for improvement but for a first version of a demo that will give people some instruction on how to use this, it's good enough.

This project showcases how to use variable rate shading (VRS)
in 3D to improve performance.

Performance metrics are also displayed to evaluate potential performance gains.
@Calinou Calinou force-pushed the add-variable-rate-shading-demo branch from 57f3e70 to fc65fd6 Compare March 30, 2023 16:28
@Calinou Calinou merged commit 199e4be into godotengine:master Mar 30, 2023
@Calinou Calinou deleted the add-variable-rate-shading-demo branch March 30, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants