The web has gone through a number of different solutions to displaying 3D graphics. here I’ll take you through the ones i’ve personally used and experienced over the years, and some of the latest developments!
Virtual Reality Markup Language
In the early days of the web (1994) there was Virtual Reality Markup Language (VRML) which allowed web pages display shapes, lighting, sound and developers to create interactive 3D worlds. However it wasn’t supported in all browsers, and had many limitations.
Macromedia and later Adobe took over the web in 1997 with Flash, which through an embedded plugin was capable of more consistent/compatible 3D graphics. However writing Flash sites required licensed software, and developers needed to learn new software and language (ActionScript) to work with the format. Flash sites quite often had large loading times and could frustrate users with slow connections.
Here I look at two additional approaches using Unity’s existing 3D engine library embedded in the browser.
a) Unity WebGL
Example Angular and Unity integration using: npm install Then view the site at: http://localhost:4200/ To communicate…
b) Unity Standalone
Another approach is to export your Unity project as a standalone player (macOS, windows, etc) which is run on a dedicated server. You can then stream the view and use web sockets to communicate and pass information between the browser and the Unity project.
In this approach we get the exact Unity graphics with full shaders and functionality, but the trade-off is that dedicated servers cost more, and users are reliant on the speed of their connection. This approach could be better for high end graphics applications which require lots of memory and users on reliable connections.
I’ve created an example project which shows how to communicate with Unity Standalone running on a server using websockets:
Example project using: Unity 2018.x Node 8.x Ws (Websockets) 6.1.x npm install Create a new Unity project: Unity > File…
Hope that helps you get started using 3D on the web!