4 ms·
Is it a Unity app exported to HTML5 (w JS and WebGL)?
by frik 9y ago
Is it a Unity app exported to HTML5 (w JS and WebGL)?
- shakna 9y ago> Made with: Three.js, Blender, Unity. Seems so.
- bhouston 9y agoIt is very strange. It seems to have a lot of Unity shader code in it. Much of it verbatim from Unity's source code. But the rest of it is Three.JS. Thus were the assets created in Unity and someone copied the shader code to ensure that they render the same in ThreeJS as in Unity? I am a little confused.
- franck 9y agoHi, I'm one of the developers. We use Unity as our main scene editor and exporter. We don't use the official WebGL exporter but a custom script that we wrote. In this project, we use it to assemble individual city blocks, that we merge to a single geometry each. We actually don't use Unity shaders at all, they are also custom made.
- bhouston 9y agoThanks for the explanation. That makes sense. Neat stuff. Btw there is proprietary/coprighted unity shader code cut and pasted into this, someobe even copied the original comments from the unity shaders. For example search for "DecodeLightmapRGBM" in the below source code, which is from the demo - that code and others are copied: https://gist.github.com/bhouston/1c3c6835ca9766571f07ad0126d70f5a https://gist.github.com/bhouston/1c3c6835ca9766571f07ad0126d... Here is some unity source code to compare against: https://gist.github.com/nicloay/8d2ae254a77de58bb42b9009b4cfa1c3 https://gist.github.com/nicloay/8d2ae254a77de58bb42b9009b4cf...
- franck 9y agoThanks, good catch. That is a copy&paste that I mistakenly left in, it wasn't used anyway. I removed it now.
- aedron 9y agoJust curious, why do you do it that way? (i.e. not just exporting from Unity)
- franck 9y agoBecause the Unity WebGL exporter doesn't currently support mobile.
- skocznymroczny 9y agoDon't know about this specific usecase, but Unity exports are heavy. I mean, it compiles C# scripts to C++ and then compiles it and Unity C++ runtime to Javascript. I easily got download sizes in tens of megabytes when trying to use Unity export for simple demos. Meanwhile Three.js is very lightweight and more than enough for such projects.
- franck 9y agoHi, no we only use Unity to assemble individual city blocks and export the data with a custom Unity script. It doesn't use the official Unity WebGL exporter.