diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index 5c4a3f2dfb..b8ce12b92f 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -801,6 +801,33 @@ require({ } function applyLoadedDemo(code, html) { + code += "const samplingOptions = [\n"+ + " {\n"+ + " text: \"MSAA off\",\n"+ + " onselect: function () {\n"+ + " viewer.scene.msaaSamples = 1;\n"+ + " }\n"+ + " },\n"+ + " {\n"+ + " text: \"MSAA 2x\",\n"+ + " onselect: function () {\n"+ + " viewer.scene.msaaSamples = 2;\n"+ + " }\n"+ + " },\n"+ + " {\n"+ + " text: \"MSAA 4x\",\n"+ + " onselect: function () {\n"+ + " viewer.scene.msaaSamples = 4;\n"+ + " }\n"+ + " },\n"+ + " {\n"+ + " text: \"MSAA 8x\",\n"+ + " onselect: function () {\n"+ + " viewer.scene.msaaSamples = 8;\n"+ + " }\n"+ + " }\n"+ + "];\n"+ + "Sandcastle.addToolbarMenu(samplingOptions);\n"; jsEditor.setValue(code); jsEditor.clearHistory(); htmlEditor.setValue(html); @@ -888,7 +915,6 @@ require({ childNode = doc.body.childNodes[++childIndex]; } htmlText = htmlText.replace(/^\s+/, ""); - applyLoadedDemo(scriptCode, htmlText); } }); diff --git a/Source/Renderer/Context.js b/Source/Renderer/Context.js index 32a534b0de..3086c6d589 100644 --- a/Source/Renderer/Context.js +++ b/Source/Renderer/Context.js @@ -175,7 +175,7 @@ function Context(canvas, options) { webglOptions.stencil = defaultValue(webglOptions.stencil, true); // WebGL default is false const requestWebgl2 = - defaultValue(options.requestWebgl2, false) && + defaultValue(options.requestWebgl2, true) && typeof WebGL2RenderingContext !== "undefined"; let webgl2 = false;