Improve description of size
and size_2d_override
for SubViewport
#10343
Labels
area:class reference
Issues and PRs about the class reference, which should be addressed on the Godot engine repository
enhancement
Your Godot version: 4.4
Issue description:
Possibly related to #5842.
The documentation for
SubViewport.size
andSubViewport.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 withSubViewport
, which I don't feel are sufficiently explained, are:size_2d_override
is a zero vector, thensize
defines both the "world size" and the output resolution of the texture generated by the SubViewport.size_2d_override
is a non-zero vector, then it defines the "world size", and thesize
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
The text was updated successfully, but these errors were encountered: