Get started for the Web

These pages tell you everything you need to know in order to get started developing projects that will run in a web browser.

In this release, you can:

You can't yet:

In addition, you may notice that not all of the rendering settings offered by the shading environment are available yet when the project is running in the browser. We're still working on making more of these high-quality effects work under WebGL.

Step 1. Install a supported browser

Stingray Web requires both WebAssembly and WebGL 2.0, which are currently supported by:

Step 2. Running the project in a web browser

To launch your project in a browser from the Stingray editor, you'll use the Connections panel to set up a new web target for each browser you want to use. (See also Using the Connections panel.)

  1. In the Connections panel (Window > Deploy and Connect > Connections), specify a name to identify the connection.

  2. Set the Platform option to Web.

  3. The Browser Path points to the .exe file for your default web browser. If it's not a supported web browser (see the list above), you'll need to browse your file system to select the .exe of the supported web browser you want to use.

  4. Leave the Command Line blank. For web connections, this defines extra parameters that are sent to the launched HTML page in the URL search string. These command-line parameters will be passed to the URL as GET parameters, which are then read by the engine and honored just like any platforms. If you want to customize the HTML page, enter the parameters here. Note that parameters that won’t make sense in the context of a web page might not yield the intended results.

  5. Press the Run Project button either from the Connections panel or from the viewport tool bar.

When you get the project successfully running in the browser, it looks something like this:

Step 3. Deploying the project to disk

To deploy your project to disk (to get it ready for hosting on a web server), you'll use the Deployer panel. Go to the tab with the HTML5 icon, set up the requested fields, and click Package Project for Web.

See also Using the Deployer panel.

About the web project output

Whether you are running the project from the Stingray editor or deploying to disk, the same engine binaries will be used for both tasks. However, in the case of deployment, the project data will additionally be bundled, just like other platforms. After deploying, looking into the final deployment folder specified in the Deployer panel, you will find:

About the launch process

Starting up a Stingray project in the browser is a multi-step process. This sequence happens automatically without you needing to do anything, but it can be helpful to know a bit about what's happening behind the scenes.

  1. Downloading. In this step, the browser is downloading and compiling the engine's runtime .wasm and .js files. The actual project data is not downloaded in this step.

    The first time you run a project in the browser, this step can take some time to complete. Subsequent launches usually go faster.

    The speed of the connection will affect the time of this step, as well as how fast your CPU can compile the WebAssembly and JavaScript files.

    In order to save time downloading the same content the next time you load the page, Stingray stores the downloaded content in your browser's IndexedDB local storage. (This can speed things up especially if you're running the project on a remote server.) You may find that you need to clear this cache from your browser if you're not seeing updates to your content as expected.

  2. Syncing resources. In this step, your project's data is either downloaded from the remote, or loaded from your browser's IndexedDB local storage.

    The first time you run a project in the browser, all files will not exist in the browser's IndexedDB local storage, so they will all be downloaded from the remote.

    On subsequent launches, most (if not all) files should be found in your IndexedDB local storage, essentially eliminating any downloads from the remote, greatly speeding up this step. Note that every browser imposes different limits on the IndexedDB local storage, so it is entirely possible some larger files or projects may fail to properly persist in the IndexedDB local storage.

  3. Loading resources. In this step, the engine is running and actually loading your project's resources into memory.

    The time this step takes to complete depends on the amount of content in your project, and what kinds of resources you're loading.

    For example, materials tend to take a long time to load up, so projects with many materials will have a longer wait here. This is because shaders making up these materials need to be compiled at run-time on this platform, but subsequent runs usually go faster when browsers have shader cache features built in.

Troubleshooting tips

If your project doesn't run in the browser: