From 1926560162c712e1f0723479c2950032114d6247 Mon Sep 17 00:00:00 2001 From: jjspace <8007967+jjspace@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:07:40 -0400 Subject: [PATCH] enable msaa by default --- Apps/Sandcastle/gallery/Bathymetry.html | 3 --- Apps/Sandcastle/gallery/I3S Building Scene Layer.html | 1 - Apps/Sandcastle/gallery/Japan Buildings.html | 1 - Apps/Sandcastle/gallery/glTF PBR Extensions.html | 2 -- CHANGES.md | 2 +- packages/engine/Source/Scene/Scene.js | 4 ++-- packages/engine/Source/Widget/CesiumWidget.js | 2 +- packages/engine/Specs/Scene/SceneSpec.js | 1 + packages/widgets/Source/Viewer/Viewer.js | 2 +- 9 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Apps/Sandcastle/gallery/Bathymetry.html b/Apps/Sandcastle/gallery/Bathymetry.html index 34b650a4a0ea..2b7ad4eabbf7 100644 --- a/Apps/Sandcastle/gallery/Bathymetry.html +++ b/Apps/Sandcastle/gallery/Bathymetry.html @@ -106,9 +106,6 @@ const scene = viewer.scene; - // prevent aliasing from countour lines - scene.msaaSamples = 4; - const globe = scene.globe; globe.enableLighting = true; globe.maximumScreenSpaceError = 1.0; // Load higher resolution tiles for better seafloor shading diff --git a/Apps/Sandcastle/gallery/I3S Building Scene Layer.html b/Apps/Sandcastle/gallery/I3S Building Scene Layer.html index 06de162a80fc..eaf58aada313 100644 --- a/Apps/Sandcastle/gallery/I3S Building Scene Layer.html +++ b/Apps/Sandcastle/gallery/I3S Building Scene Layer.html @@ -56,7 +56,6 @@
render
are always caught in order to raise the
diff --git a/packages/engine/Source/Widget/CesiumWidget.js b/packages/engine/Source/Widget/CesiumWidget.js
index 7e45d1e0fb54..20b2e7172ec2 100644
--- a/packages/engine/Source/Widget/CesiumWidget.js
+++ b/packages/engine/Source/Widget/CesiumWidget.js
@@ -143,7 +143,7 @@ function configureCameraFrustum(widget) {
* @param {boolean} [options.blurActiveElementOnCanvasFocus=true] If true, the active element will blur when the viewer's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element.
* @param {boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
* @param {number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
- * @param {number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
+ * @param {number} [options.msaaSamples=4] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets. Set to 1 to disable MSAA.
*
* @exception {DeveloperError} Element with id "container" does not exist in the document.
*
diff --git a/packages/engine/Specs/Scene/SceneSpec.js b/packages/engine/Specs/Scene/SceneSpec.js
index 78f0eb33fe18..8b6bb475c1ac 100644
--- a/packages/engine/Specs/Scene/SceneSpec.js
+++ b/packages/engine/Specs/Scene/SceneSpec.js
@@ -137,6 +137,7 @@ describe(
expect(scene.mapProjection).toBeInstanceOf(GeographicProjection);
expect(scene.frameState).toBeInstanceOf(FrameState);
expect(scene.tweens).toBeInstanceOf(TweenCollection);
+ expect(scene.msaaSamples).toEqual(4);
const contextAttributes = scene.context._gl.getContextAttributes();
// Do not check depth and antialias since they are requests not requirements
diff --git a/packages/widgets/Source/Viewer/Viewer.js b/packages/widgets/Source/Viewer/Viewer.js
index 20572ebece87..4b4f8cf35e26 100644
--- a/packages/widgets/Source/Viewer/Viewer.js
+++ b/packages/widgets/Source/Viewer/Viewer.js
@@ -342,7 +342,7 @@ function enableVRUI(viewer, enabled) {
* @property {boolean} [requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
* @property {number} [maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
* @property {number} [depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
- * @property {number} [msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
+ * @property {number} [msaaSamples=4] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets. Set to 1 to disable MSAA.
*/
/**