mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 14:10:55 +03:00
It turns out using a TextureRect node isn't necessary :) The typical ViewportContainer + Viewport setup can be used just fine to enable filtering on the ViewportTexture returned by the Viewport. The performance of the new method is equivalent to the old one.
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
; Engine configuration file.
|
|
; It's best edited using the editor UI and not directly,
|
|
; since the parameters that go here are not all obvious.
|
|
;
|
|
; Format:
|
|
; [section] ; section goes between []
|
|
; param=value ; assign values to parameters
|
|
|
|
config_version=4
|
|
|
|
_global_script_classes=[ ]
|
|
_global_script_class_icons={
|
|
|
|
}
|
|
|
|
[application]
|
|
|
|
config/name="3D Viewport Scaling"
|
|
config/description="This demo shows how to scale the 3D viewport rendering without affecting 2D
|
|
elements such as the HUD. It also demonstrates how to toggle filtering on a
|
|
viewport. This technique can be useful in 2D games as well. For instance, it can
|
|
be used to have a \"pixel art\" viewport for the main game area and a
|
|
non-pixel-art viewport for HUD elements."
|
|
run/main_scene="res://hud.tscn"
|
|
config/icon="res://icon.png"
|
|
|
|
[display]
|
|
|
|
window/dpi/allow_hidpi=true
|
|
window/stretch/mode="2d"
|
|
window/stretch/aspect="expand"
|
|
|
|
[input]
|
|
|
|
cycle_viewport_resolution={
|
|
"deadzone": 0.5,
|
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
|
]
|
|
}
|
|
toggle_filtering={
|
|
"deadzone": 0.5,
|
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null)
|
|
]
|
|
}
|
|
|
|
[rendering]
|
|
|
|
quality/driver/driver_name="GLES2"
|
|
quality/intended_usage/framebuffer_allocation=3
|
|
environment/default_environment="res://default_env.tres"
|