PlayCanvas REST API


Today we’re launching the first version of the PlayCanvas REST API.

The REST API is available to all Organization account holders and allows developers to automate processes to help them with their development. For example, you can use the API to create a daily build of your application and download it via a build server. In the future we’ll be expanding the API with additional features like access to assets and more.

You can read more details about the API in the documentation.

We’d love to hear your thoughts on how you are using the API and what you’d like to see in the future. Let us know on our forum.

PlayCanvas versus Unreal WebGL

Our previous article comparing PlayCanvas with Unity’s WebGL exporter certainly got folks talking. One of the questions that came up in the aftermath was “OK, but what about Unreal’s WebGL exporter?”. Unreal, like Unity, relies on Emscripten to port the native codebase to JavaScript. So it would be reasonable to expect Unreal to suffer from the same issues as Unity: large download sizes, long load times and poor runtime performance.


PlayCanvas versus Unity WebGL

A question we get asked a lot is “How does PlayCanvas compare to Unity’s WebGL export?”. So let’s examine this in a blog post.


Organizations & new plans

Today we’re pleased to launch Organizations for PlayCanvas users along with an updated and simplified set of plans including unlimited projects and more storage.


Realtime Chat Lands in the PlayCanvas Editor

Hot on the heels of the new scripting system, we’re happy to announce the arrival of realtime chat in the PlayCanvas Editor!


PlayCanvas Scripts 2.0

We’ve just launched “Scripts 2.0”, a complete re-design and re-implementation of the scripting system for PlayCanvas applications. Our goals were to fix an array of small irritations that had built up over using the PlayCanvas scripting for the last few years and take the opportunity to clean up the interface and simplify the creation and usage of scripts.

Here’s a list of the improvements you can enjoy with the new script system:

  • rapid iteration by hot-swapping code at run-time
  • real-time collaborative code editing
  • script concatenation and minification for publishing
  • better error handling and fault tolerance
  • full folder support for script assets
  • multiple script definitions in a single file
  • simpler interface and boilerplate

Live hot-swapping

If you choose to, you can now allow your scripts to update all running instances of your application. We dynamically reload scripts after they change. By implementing a single swap() function, you can transfer state into your new script instance and carry on as if nothing had happen. Except you’ve got all your new code!

Real-time collaborative code editing

Now that scripts are first-class assets, we now support real-time collaboration in the Code Editor. This means you’re no longer in danger overwriting other people’s code. In fact, you can see it appear as they type.

To help support this, we’ve also improved the error handling and fault tolerance of scripts while they’re running. This means bad scripts won’t bring your game screeching to a halt, preventing everyone from working.

Script Concatenation

With the new script format we now support multiple script definitions in a single JavaScript file. We’ve added the option to concatenate and minify all your scripts into one file when you publish. This will save you many HTTP requests and reduces the size of your application, making for a much quicker start up time.

How do you find these new scripts?

Scripts 2.0 is live right now and any new projects you create will have the new script system enabled. However, if you’re not quite ready to move to the new system or you need some of the features that are currently only available with the old system, you can still create projects using the “Legacy Script System”. Look for the option in the new project dialog.

If you haven’t tried PlayCanvas before:


Getting started with WebVR


Did you hear? VR is BIG! But what is bigger than VR? The web, that’s what. What happens when you mix the web and VR?

WebVR is an emerging standard that lets you create 3D virtual experiences on the web and control them using your mobile phone or VR headset. But creating virtual reality is a complex process involving knowledge of WebGL rendering, new input APIs and (at the moment) a constantly changing spec.

That’s why we’ve introduced the VR Starter Kit in PlayCanvas.


Variance Shadow Maps for WebGL and More!

May is drawing to a close and it’s starting to feel like summer here in London. Let’s celebrate with a PlayCanvas Dev Update! We’ve been busy bees, so here’s a rundown of the main changes.

Variance Shadow Maps

The light component now allows you to select a shadow type. In addition to the current PCF Shadow Maps, there are new options for 8-bit, 16-bit and 32-bit Variance Shadow Maps. 8-bit VSM uses a small amount of GPU memory and is guaranteed to work on any device but is lower quality. 32-bit VSM uses a lot of GPU memory and relies on a device’s ability to render to floating point textures but the quality is very good. 32-bit VSM will gracefully fall back to 16-bit and then to 8-bit should the device not provide the required capabilities.

Let’s compare PCF with VSM. First, here’s PCF:


And here is VSM:


The big advantage of VSM is the ability to apply large blur kernels, which would be prohibitively slow with PCF. As you can see, the results are most pleasing!

VSM is still work in progress so expect more updates to land in the engine in the coming weeks.

Reworked Editor Camera Controls

We’ve completely rewritten the controls for the Editor camera in the 3D view. It should be far more intuitive now and also enable you to be more productive. For example, we have changed the behavior of dollying the camera to be based on what the mouse cursor is pointing at. This makes it feel much more similar to Google Maps:


Easy Asset Inspection in Dev Tools

We’ve made it so your assets are displayed in your browser’s Dev Tools as they are in Editor’s Asset Panel. This makes it much easier to locate, inspect and debug when running your game launched from the Editor.


Engine Optimizations

We’ve performed a thorough round of engine optimizations, aimed at speeding up your games, but also to reduce memory allocations to avoid garbage collection stalls. Specifically, we have:

  • Created a special profile build of the engine which is now only used when you run the PlayCanvas Profiler from the Editor. The regular non-profile build has the code that collects all of the timing and statistical information stripped out.
  • Optimized many commonly used functions. Here is a good example.
  • Removed many allocations that used to happen at runtime. Here is a good example.

Other Changes

  • Editor tooltips have been refactored with any missing ones added.
  • Improved reporting of an asset’s references when right clicking it in the Asset Panel.

New Tutorials: Multiplayer with Node.js and WebGL & Facebook SDK

We’ve added two new tutorials to our developer site this week.

How to create a real time multiplayer game with Node.js and PlayCanvas – READ MORE

Real ti

How to use the Facebook SDK in your WebGL application – READ MORE


You can find loads more tutorials on our developer site.

Runtime Lightmap Generation for WebGL

For many years, lightmapping has been the mainstay of achieving low cost yet realistic lighting. However, it’s rarely seen in WebGL applications because generating lightmaps requires third-party modelling applications with complex workflows in order to bake out textures.

All that changes today as we introduce Runtime Lightmap Generation into the PlayCanvas Engine.