-
-
Notifications
You must be signed in to change notification settings - Fork 215
Antialiasing
WebGL 1 doesn't support multisampled render targets. Therefore, the default antialiasing (MSAA) has no effect in post processing pipelines. It's recommended to set antialias
to false
when creating a WebGLRenderer
for a post processing setup.
The SMAA technique implements efficient antialiasing for post processing pipelines. The postprocessing
library provides the SMAAEffect as a default antialiasing solution.
SMAA uses two data images as look-up-tables to detect aliasing artifacts. "The technique focuses on handling each pattern in a very specific way (via look-up-tables), in order to minimize false positives in the pattern detection. Ultimately, this prevents antialiasing features that are not produced by jaggies, like texture details."
The SMAAEffect
could theoretically generate these images, similar to how the GlitchEffect
generates a default noise texture. However, generating these images procedurally takes a significant amount of time. Therefore, the pre-generated images are provided as plain strings that can be loaded quickly.
If you want to know what the data images look like, you can find them here:
The area and search images are stored as base64-encoded, PNG-compressed strings to minimize their impact on the size of your final product. The best way to load them is by using the native Image
class. Loading images is always asynchronous, even if the src
property is set to a base64 data string. Since the process is asynchronous it's best to leave the loading to the user so that he/she has full control over it.