PlayCanvas models without normals

I have some questions/suggestions about using PlayCanvas’ online editor:

I am converting Wavefront .obj files to PlayCanvas .json using the online editor. If I save the .obj files without normal maps, the online editor automatically adds faceted normals to the .json files. I want to use these faceted normals because they look much better than the normals that come with my models. Excluding normals from the .obj files also has the benefit of making the .obj files 5 times smaller, but it does not make the .json files smaller because the online editor is adding the faceted normals to them. Is it possible for PlayCanvas to load models without normal maps and then use the same algorithm that the online editor uses to generate the faceted normals on the fly? The models would load much faster because the faceted normals would not need to be downloaded.

I can also decrease the size of my .obj files by using relative vertex numbers, but the online editor is only exporting absolute vertex numbers. It appears that glTF files, and especially Binary glTF (.glb files) are much smaller than either .obj or .json. Is PlayCanvas compatible with any model format that is optimized for efficient transfer? This seems like an important feature considering that PlayCanvas is designed to run in a web browser.

Finally, my .obj files have 12 digits of precision, but the online editor is limiting the precision to 6 digits. Is it possible for the online editor to export models using 12 digits of precision?

Thanks in advance for addressing these issues.

Hi @prelkin. Those are good questions, will go though them:

Models without some data, such as normals is not yet supported. Only uv1 (second) and color attributes are optional. There was a talk regarding this actually, to allow importing options on models which would allow to dismiss normals from source model. Although generating normals for it is not super-fast process in JS, and might be too costly for models with large number of vertices.
This is something was planned, but never had an urgent need to be implemented. Plus all material shader chunks, that rely on availability of such data would have to be expanded as well, new chunks created to support such shader branching option.

Regarding model format efficiency. Actually if you look at it in terms of json + gzip, it is giving fairly good results. We did some experiments with binary model formats, and just using binary - made no much difference in terms of size. So we need to do number of things: sorting to benefit from compression, use other techniques to reduce bit size for some normalized attributes without visually loosing on quality, and think about speed of parsing of model format in JS after it is downloaded - it is critical to be fast here, as complex parsing of large models will lead to thread blocking, and doing in a worker (another thread) will introduce another async latency to it.

glTF is not supported yet, and there is a ticket in engine for it.

Those are only thoughts and we did not started working on implementing any of it. Practically those are minor differences in real-world applications, where textures take most of download sizes.

Thank you for your response to my questions. I am trying to download models without normals and then generate faceted normals on the fly before the models are loaded in PlayCanvas. When a model is missing normals, the online editor automatically generates faceted normals while converting the model to .json. I removed those normals from my .json files and I want my JavaScript code to recreate them so the normals do not need to be downloaded. I found an algorithm for calculating normals, but it does not match the normals generated by the online editor. Could you please tell me the formula that the online editor is using to create the faceted normals?

For example, for a triangle with these vertices:
{ 1, 1, 1 }
{ 1, 2, 1 }
{ 2, 1, 2 }

the online editor generates these normals:
(√2 / 2), 0, (√2 / -2), (√2 / 2), 0, (√2 / -2), (√2 / 2), 0, (√2 / -2)