Babylon Unity Toolkit and React

@brianzinn Thank you for your quick response!

The toolkit has two options for export output, 1) A web project 2) Just the babylon scene (in my case glb), the scene javasript file and a folder with textures.

In the case of (1), it comes with an html index along with source folders for scripts and scenes. The html index sources all scripts, runs a lot of supplemental code then loads the babylon scene on the page and this works well for standard website because you can just add your content to the boilerplate html .

in the case of (2) If you manually try to load the scene in either a standard web app or component you get multiple errors for different issues that basically boils down to the fact that the scene.js file requires the babylon.scenemanager.js file which is only exported in case (1). Here is a thread from an issue pertaining to just that:

@MackeyK24, can you provide some insight here?
I think ultimately I may try an alternative exporter (GitHub - Plattar/gltf-exporter: Unity3D GLTF2 importer and exporter toolchain) and compare outputs, I’m just not sure if it exports lightmaps as well as the Toolkit :slight_smile:

@brianzinn I think you are spot on with the next/dynamic solution for dealing with importing and after further reading, I believe that can work in delivering the content; But the ultimate goal with this project and using Next.js was to test different efficiencies of SSR with babylon/webgl content as there is very limited test/use cases online. From what I understand Next.js would render the page and initial canvas on server then serve to client, and I want to see the different results using this method. Either way thank you because solution or not, I will try this as a means of comparing performance between CSR and SSR.

1 Like