Skip to content

Commit b521095

Browse files
committed
Add a 3D antialiasing demo
1 parent ae57eb2 commit b521095

17 files changed

+1303
-0
lines changed

3d/antialiasing/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 3D Anti-Aliasing
2+
3+
This project showcases the various 3D antialiasing techniques supported by Godot.
4+
5+
- **Multisample antialiasing (MSAA):** High quality, high performance cost.
6+
Does not blur the image.
7+
- Does not affect shader-induced aliasing (such as specular aliasing) or alpha
8+
scissor materials, so these will remain aliased.
9+
- **Fast approximate antialiasing (FXAA):** Medium quality, low performance cost.
10+
Slightly blurs the image.
11+
- **Temporal antialiasing (TAA):** High-quality, low performance cost. Slightly
12+
blurs the image (but less so than FXAA).
13+
- Antialiasing quality is worse on fast-moving objects than other methods,
14+
especially at lower framerates since the TAA won't have enough time to
15+
converge on those objects.
16+
- Can introduce ghosting artifacts on moving objects, especially if motion
17+
vectors are not correctly generated from a given material shader.
18+
- **Supersampling (SSAA):** The highest-quality technique, but also the most
19+
expensive. Does not blur the image.
20+
- 200% resolution scale is equivalent to 4× SSAA, as each dimension is
21+
doubled. For example, if running in a 1920×1080 window at 200% render scale,
22+
the 3D framebuffer will be 3840×2160.
23+
- SSAA can be used together with FXAA or TAA to counter the blurring added by
24+
those algorithms, while further improving antialiasing quality.
25+
26+
Godot allows using multiple antialiasing techniques at the same time. This can
27+
be useful to obtain the best possible quality, or to find a better performance
28+
tradeoff.
29+
30+
Language: GDScript
31+
32+
Renderer: Vulkan Clustered
33+
34+
## Screenshots
35+
36+
![Screenshot](screenshots/3d_anti_aliasing.png)

3d/antialiasing/checker.LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# License for `checker.png`
2+
3+
Copyright (c) 2020 Kenney
4+
5+
Licensed under CC0 1.0 Universal.
6+
7+
Downloaded from https://kenney.nl/assets/prototype-textures

3d/antialiasing/checker.png

1.87 KB
Loading

3d/antialiasing/checker.png.import

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://chjqieyps5n5r"
6+
path.s3tc="res://.godot/imported/checker.png-6bb199bedbd039461e4248c1d0b9691d.s3tc.ctex"
7+
path.etc2="res://.godot/imported/checker.png-6bb199bedbd039461e4248c1d0b9691d.etc2.ctex"
8+
metadata={
9+
"imported_formats": ["s3tc", "etc2"],
10+
"vram_texture": true
11+
}
12+
13+
[deps]
14+
15+
source_file="res://checker.png"
16+
dest_files=["res://.godot/imported/checker.png-6bb199bedbd039461e4248c1d0b9691d.s3tc.ctex", "res://.godot/imported/checker.png-6bb199bedbd039461e4248c1d0b9691d.etc2.ctex"]
17+
18+
[params]
19+
20+
compress/mode=2
21+
compress/lossy_quality=0.7
22+
compress/hdr_compression=1
23+
compress/bptc_ldr=0
24+
compress/normal_map=0
25+
compress/channel_pack=0
26+
mipmaps/generate=true
27+
mipmaps/limit=-1
28+
roughness/mode=0
29+
roughness/src_normal=""
30+
process/fix_alpha_border=true
31+
process/premult_alpha=false
32+
process/normal_map_invert_y=false
33+
process/hdr_as_srgb=false
34+
process/size_limit=0
35+
detect_3d/compress_to=0

3d/antialiasing/default_env.tres

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[gd_resource type="Environment" load_steps=2 format=2]
2+
3+
[sub_resource type="Sky" id=1]
4+
5+
[resource]
6+
background_mode = 2
7+
sky = SubResource( 1 )

3d/antialiasing/icon.png

18.7 KB
Loading

3d/antialiasing/icon.png.import

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://8c1xtc7yj6s5"
6+
path.s3tc="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.ctex"
7+
path.etc2="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.ctex"
8+
metadata={
9+
"imported_formats": ["s3tc", "etc2"],
10+
"vram_texture": true
11+
}
12+
13+
[deps]
14+
15+
source_file="res://icon.png"
16+
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.ctex", "res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.ctex"]
17+
18+
[params]
19+
20+
compress/mode=2
21+
compress/lossy_quality=0.7
22+
compress/hdr_compression=1
23+
compress/bptc_ldr=0
24+
compress/normal_map=0
25+
compress/channel_pack=0
26+
mipmaps/generate=true
27+
mipmaps/limit=-1
28+
roughness/mode=0
29+
roughness/src_normal=""
30+
process/fix_alpha_border=true
31+
process/premult_alpha=false
32+
process/normal_map_invert_y=false
33+
process/hdr_as_srgb=false
34+
process/hdr_clamp_exposure=false
35+
process/size_limit=0
36+
detect_3d/compress_to=0

3d/antialiasing/paint.LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# License for `paint.png` and `paint_normal.png`
2+
3+
Copyright (c) 2010 johndn
4+
5+
Licensed under CC BY 3.0 Unported.
6+
7+
Downloaded from https://opengameart.org/content/splatter-pack

3d/antialiasing/paint.png

29.6 KB
Loading

3d/antialiasing/paint.png.import

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://ccgkupemr6e1q"
6+
path="res://.godot/imported/paint.png-26dd29729d733230544ae1ff468a1f09.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://paint.png"
14+
dest_files=["res://.godot/imported/paint.png-26dd29729d733230544ae1ff468a1f09.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/lossy_quality=0.7
20+
compress/hdr_compression=1
21+
compress/bptc_ldr=0
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/size_limit=0
33+
detect_3d/compress_to=1

0 commit comments

Comments
 (0)