Commit 85ebd67
authored
feat(taa): Overhaul TAA implementation for improved quality and upscaling (#9573)
This commit introduces a significant rework of the Temporal Anti-Aliasing (TAA) system, focusing on improving reconstruction quality, robustness, and introducing flexible upscaling.
Core TAA Algorithm improvements:
- Replaced the Catmull-Rom filter with a more efficient 5-tap Lanczos filter for history sampling, which includes deringing to reduce artifacts.
- The input color buffer is now properly "unjittered" using a Lanczos reconstruction filter.
- Improved the history rejection algorithm by skipping the expensive accurate clipping when the history sample is already within the neighborhood's color gamut.
- Added a new `hdr` option to properly handle HDR content by tonemapping colors before blending and untonemapping the result.
- Removed the ineffective `VARIANCE` only history rejection method.
- Added protection against negative numbers in `sqrt()` for increased stability.
TAA Upscaling:
- Replaced the boolean `upscaling` flag with a float factor, allowing for variable upscaling ratios (e.g., 1.5x, 2x).
- Upscaling now correctly adjusts viewport and projection settings.
- The TAA shader now receives viewport and resolution information to correctly handle upscaled rendering.
API and Configuration Changes:
- Deprecated the `filterWidth` TAA option as it no longer has an effect.
- Introduced the `upscaling` float property to `TemporalAntiAliasingOptions`.
- Added the `hdr` boolean property to `TemporalAntiAliasingOptions`.
Other Changes:
- Updated UI elements in the viewer and material sandbox to reflect the new TAA options.
- Updated Javascript bindings and TypeScript definitions for the new TAA settings.
- Refactored shader code for clarity and performance.1 parent f33a779 commit 85ebd67
File tree
14 files changed
+326
-206
lines changed- android/filament-android/src/main/java/com/google/android/filament
- filament
- include/filament
- src
- details
- materials/antiAliasing/taa
- libs/viewer/src
- samples
- web/filament-js
14 files changed
+326
-206
lines changedLines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2041 | 2041 | | |
2042 | 2042 | | |
2043 | 2043 | | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
2048 | 2044 | | |
2049 | 2045 | | |
2050 | 2046 | | |
| |||
2075 | 2071 | | |
2076 | 2072 | | |
2077 | 2073 | | |
2078 | | - | |
| 2074 | + | |
2079 | 2075 | | |
2080 | 2076 | | |
2081 | 2077 | | |
| |||
2095 | 2091 | | |
2096 | 2092 | | |
2097 | 2093 | | |
2098 | | - | |
| 2094 | + | |
2099 | 2095 | | |
2100 | | - | |
| 2096 | + | |
2101 | 2097 | | |
2102 | 2098 | | |
2103 | 2099 | | |
| |||
2110 | 2106 | | |
2111 | 2107 | | |
2112 | 2108 | | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
2113 | 2113 | | |
2114 | 2114 | | |
2115 | 2115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
502 | 501 | | |
503 | 502 | | |
504 | 503 | | |
| |||
519 | 518 | | |
520 | 519 | | |
521 | 520 | | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2911 | 2911 | | |
2912 | 2912 | | |
2913 | 2913 | | |
2914 | | - | |
| 2914 | + | |
2915 | 2915 | | |
2916 | 2916 | | |
2917 | 2917 | | |
2918 | 2918 | | |
| 2919 | + | |
2919 | 2920 | | |
2920 | 2921 | | |
2921 | 2922 | | |
| |||
2984 | 2985 | | |
2985 | 2986 | | |
2986 | 2987 | | |
| 2988 | + | |
| 2989 | + | |
2987 | 2990 | | |
2988 | 2991 | | |
2989 | 2992 | | |
| |||
3013 | 3016 | | |
3014 | 3017 | | |
3015 | 3018 | | |
3016 | | - | |
3017 | | - | |
3018 | | - | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
3019 | 3022 | | |
3020 | 3023 | | |
3021 | 3024 | | |
| |||
3047 | 3050 | | |
3048 | 3051 | | |
3049 | 3052 | | |
3050 | | - | |
3051 | | - | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
| 3053 | + | |
3055 | 3054 | | |
3056 | | - | |
3057 | | - | |
3058 | | - | |
3059 | | - | |
3060 | | - | |
3061 | | - | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
3062 | 3058 | | |
3063 | | - | |
3064 | | - | |
3065 | | - | |
3066 | | - | |
3067 | | - | |
3068 | | - | |
3069 | | - | |
3070 | | - | |
3071 | | - | |
3072 | | - | |
3073 | | - | |
| 3059 | + | |
| 3060 | + | |
3074 | 3061 | | |
3075 | | - | |
3076 | | - | |
3077 | | - | |
3078 | | - | |
3079 | | - | |
3080 | | - | |
3081 | | - | |
3082 | | - | |
3083 | | - | |
3084 | | - | |
3085 | | - | |
3086 | | - | |
3087 | | - | |
3088 | | - | |
3089 | | - | |
3090 | | - | |
3091 | | - | |
3092 | | - | |
3093 | | - | |
3094 | | - | |
3095 | | - | |
3096 | | - | |
3097 | | - | |
3098 | | - | |
3099 | 3062 | | |
3100 | 3063 | | |
3101 | 3064 | | |
| |||
3106 | 3069 | | |
3107 | 3070 | | |
3108 | 3071 | | |
3109 | | - | |
3110 | 3072 | | |
3111 | 3073 | | |
3112 | 3074 | | |
3113 | 3075 | | |
3114 | | - | |
3115 | | - | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
3116 | 3083 | | |
3117 | 3084 | | |
3118 | 3085 | | |
3119 | 3086 | | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
3120 | 3103 | | |
3121 | 3104 | | |
3122 | 3105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
| |||
688 | 690 | | |
689 | 691 | | |
690 | 692 | | |
691 | | - | |
| 693 | + | |
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
695 | 697 | | |
696 | 698 | | |
697 | | - | |
| 699 | + | |
698 | 700 | | |
699 | 701 | | |
700 | 702 | | |
| |||
781 | 783 | | |
782 | 784 | | |
783 | 785 | | |
784 | | - | |
| 786 | + | |
785 | 787 | | |
786 | 788 | | |
787 | 789 | | |
788 | 790 | | |
789 | 791 | | |
790 | | - | |
791 | | - | |
| 792 | + | |
| 793 | + | |
792 | 794 | | |
793 | 795 | | |
794 | 796 | | |
| |||
1309 | 1311 | | |
1310 | 1312 | | |
1311 | 1313 | | |
1312 | | - | |
| 1314 | + | |
| 1315 | + | |
1313 | 1316 | | |
1314 | | - | |
| 1317 | + | |
1315 | 1318 | | |
1316 | 1319 | | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1317 | 1325 | | |
1318 | 1326 | | |
1319 | 1327 | | |
1320 | | - | |
1321 | | - | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1322 | 1334 | | |
1323 | 1335 | | |
1324 | 1336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
325 | 323 | | |
| 324 | + | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
| 354 | + | |
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| |||
0 commit comments