-
Notifications
You must be signed in to change notification settings - Fork 0
/
node_2d.gd
22 lines (17 loc) · 835 Bytes
/
node_2d.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
extends Node2D
func _ready() -> void:
DirAccess.make_dir_recursive_absolute("user://tutorials/2d/img")
%SubViewport.msaa_2d = Viewport.MSAA_2X
%AALabel.text = "2× MSAA"
await RenderingServer.frame_post_draw
get_viewport().get_texture().get_image().save_png("user://tutorials/2d/img/antialiasing_msaa_2x.png")
%SubViewport.msaa_2d = Viewport.MSAA_4X
%AALabel.text = "4× MSAA"
await RenderingServer.frame_post_draw
get_viewport().get_texture().get_image().save_png("user://tutorials/2d/img/antialiasing_msaa_4x.png")
%SubViewport.msaa_2d = Viewport.MSAA_8X
%AALabel.text = "8× MSAA"
await RenderingServer.frame_post_draw
get_viewport().get_texture().get_image().save_png("user://tutorials/2d/img/antialiasing_msaa_8x.png")
OS.shell_open(ProjectSettings.globalize_path("user://tutorials/2d/img"))
get_tree().quit()