Hey everyone,
i am getting this Error messsage: "Problem loading Scene Viewer
Your browser isn't using hardware acceleration for rendering which is required for displaying interactive 3D scenes." trying to load a sceneView from esri portal in my virtual machine.
I was wondering how you implemented the check to see if hardware acceleration is supported since we need to implement the same check in our implementation to fall back to 2D if hardware acceleration is not supported. Thanks in advance 🙂
Hello,
Here is the system requirement for ArcGIS Scene Viewer:
Scene Viewer requirements—ArcGIS Enterprise | Documentation for ArcGIS Enterprise
You can ask your IT department to check if the systems you are using meet the minimal requirements.
I know there are requirements using the scene viewer. We are using the Arcgis npm lib to develop a system that provides both a 2d and a 3d view. On startup I want to check via JS if the requirements for 3d are met and if not block that view.
I have tried working with a method like this, but that check wasn't really working and simulating the execution in a vim while development is also not that easy:
export function isHardwareAccelerationPossible() {
const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl');
if (!gl) {
return false; // WebGL is not supported
}
// Check for SwiftShader in Chrome
const debugExt = gl.getExtension('WEBGL_debug_renderer_info');
if (debugExt) {
const renderer = gl.getParameter(debugExt.UNMASKED_RENDERER_WEBGL);
if (renderer.indexOf('SwiftShader') >= 0) {
// Hardware acceleration is not possible
return false;
}
}
// Check for ANGLE_instanced_arrays in Firefox
const angleExt = gl.getExtension('ANGLE_instanced_arrays');
if (!angleExt) {
// Hardware acceleration is not possible
return false;
}
// Hardware acceleration is possible
return true;
}
Hi Jonas
I think what you might want to do for a fallback is that you add failIfMajorPerformanceCaveat when you get the canvas:
let context = canvas.getContext("webgl2", { failIfMajorPerformanceCaveat: true });
// if this failed, it might be due to a major performance caveat
if (context == null) {
// try again without the failIfMajorPerformanceCaveat constraint
context = canvas.getContext("webgl2");
// if it succeeded now the previous failure must have been due to that constraint
if (context != null) {
capabilities.majorPerformanceCaveat = true;
}
}
Then show the message or fallback if
capabilities.majorPerformanceCaveat = true
Documentation to this flag can be found here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
Here's something you can try if you want to get past your initial Scene Viewer error.
On virtual machine browser, navigate to edge://flags on Microsoft Edge (or chrome://flags in Chrome), then enable Override software rendering list.
Wow i didn't know that was possible, thanks! I would still have to know if the problem is there so i can change the default view or tell the users about the solution although its not really usable with the lag 🙂