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

Improve description of size and size_2d_override for SubViewport #10343

Open
Meorge opened this issue Nov 29, 2024 · 0 comments
Open

Improve description of size and size_2d_override for SubViewport #10343

Meorge opened this issue Nov 29, 2024 · 0 comments
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@Meorge
Copy link

Meorge commented Nov 29, 2024

Your Godot version: 4.4

Issue description:

Possibly related to #5842.

The documentation for SubViewport.size and SubViewport.size_2d_override is rather lacking. They seem like they largely just restate the name of the properties without extra elaboration on what they do. The key points I've picked up on from experimenting with SubViewport, which I don't feel are sufficiently explained, are:

  • If size_2d_override is a zero vector, then size defines both the "world size" and the output resolution of the texture generated by the SubViewport.
  • If size_2d_override is a non-zero vector, then it defines the "world size", and the size property defines only the output resolution.

My use case for this is that I'd designed some scenes meant to be played through a SubViewport, where objects were placed for a 1920x1080 screen size. However, I wanted to render the SubViewport at a smaller resolution for performance reasons. To accomplish this, I had to use the following settings:

  • size = Vector2(480, 270) (the actual resolution of the texture I wanted the SubViewport to produce)
  • size_2d_override = Vector2(1920, 1080) (the size I wanted the in-game world to act like it was rendering to)
  • size_2d_override_stretch = true (not certain what/how much this contributed? need to do more research)

URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_subviewport.html

@tetrapod00 tetrapod00 added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

No branches or pull requests

2 participants