-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement MSAA with WebGL 2 #9900
Comments
Before adding MSAA in a production way we should get a bunch of representative sandcastle examples together and compare different AA techniques. For side by side comparisons we should test:
We already have FXAA as a post process. SSAA can be done by setting We should also put together a very basic, non-production prototype for MSAA to see what it looks like. This can be hacked into By default Once we have all these techniques side by side we should decide whether we go down the path of MSAA. It will take a bit of work to integrate it into CesiumJS. MSAA also has a memory cost for both color textures and depth textures. Here are some other notes that may be relevant:
|
I think implementing SMAA would be quite lovely. The currently implemented FXAA does work, but the resulting quality leaves a lot to be desired. SMAA supposedly does a much better, while only having a slightly higher performance cost. It would most certainly make the jaggy lines look nicer. |
Expect this feature |
@ebogo1 could you put together a sandcastle where you can switch between a few scenarios (including the two above) and a dropdown that lets you select the AA mode (FXAA, SMAA, None) and a checkbox for I've very interested to see how it looks in action. SMAA seems equal or better than FXAA. |
SMAA findingsI put together a hacky branch with SMAA shaders from Three.js (see Three's SMAAPass.js and SMAAShader.js). First thoughts are that it's seems much more straightforward than trying to integrate MSAA (plus it works with WebGL 1) and looks comparable but better than FXAA. I've posted a few comparison screenshots - #9900 (comment). As a really high-level overview, SMAA consists of three passes:
In CesiumJS, this means two A couple related resources:
|
MSAA findingsI made another branch for testing MSAA; to make it quicker to integrate, there are a couple hacky changes to use There are some weird issues that may be a result of the A brief list of changes in the MSAA branch:
Here is a Sandcastle from the MSAA branch with the same scenarios as the SMAA Sandcastle and a dropdown to change the number of MSAA samples. This Sandcastle requires WebGL 2. |
Based on the results from prototyping MSAA and SMAA, we decided to move forward with MSAA as an option for WebGL 2 contexts. The plan is split across a couple PRs, but details might change once I work through more of these changes -
|
Really cool changes coming up, thanks a lot dev team :) SMAA isn´t going to make it to cesium then, right? |
@FabianAhammer We're looking at adding SMAA as a toggle-able option like FXAA, but for now focusing on MSAA. |
CesiumJS has noticeable aliasing artifacts, especially with thin geometry (see #8228). With multisampled render targets in WebGL 2, MSAA is a good step towards fixing them.
To implement MSAA in CesiumJS, we need to decide which render targets will need to get multisampled to avoid artifacts. One idea was to start with the color framebuffer in GlobeDepth.js. There are also questions about how this would interact with translucency passes, and whether there might need to be additional logic for compute commands to perform MSAA if needed.
I'm opening this issue to have a space to discuss the MSAA roadmap and implementation details for CesiumJS.
The text was updated successfully, but these errors were encountered: