Cannot display smooth shading in Three.js

Messages
26th April 2017 - 07:36:18 AM
Model that exported without normals will display in Three.js as FlatShading, but I want to display it as SmoothShading (the purpose of not export normals from beginning is it will decrease a lot in file size)

I can't find a way to achieve SmoothShading.

I've tried computeVertexNormals, computeFaceNormals, material shading is Smooth but the model is still in FlatShading.

I attached example mesh, just the default teapot from 3ds max exported without normals
Download tea.sea 9.68 kB | Open with SEA3D Studio
27th April 2017 - 11:59:28 AM
Hi.

Try use Mesh Optimizer option in SEA3D Exporter. Otherwise, it will export as Polygon soup.
meshoptimizer
27th April 2017 - 12:01:29 PM
Open3DGC is a good alternative to reduce the file size.
http://community.poonya.com/224
27th April 2017 - 12:27:37 PM
Mesh Optimizer was is actived as default in older SEA3D Exporter versions. I am coming back like this before with a new preset.

mesh optimizer = true - https://github.com/sunag/sea3d/commit/70498030d0332d1925e32ba0114f9b8ff6f4c782
new Polygon soup preset - https://github.com/sunag/sea3d/commit/a0f2e646447e23978f4f04d6d9baeb41eec976fc
28th April 2017 - 02:35:20 PM
Thank you, but export with Mesh Optimizer didn't work, it still be in FlatShading.

This is my code to compute normal for all loaded mesh:

for ( var i = 0, len = meshLoader.meshes.length; i < len; i++ ) {
var geo = meshLoader.meshes[i].geometry;
geo.computeFaceNormals();
geo.computeVertexNormals();
geo.attributes.normal.needsUpdate = true
}
Download tea-mesh-optimizer.sea 18.16 kB | Open with SEA3D Studio
28th April 2017 - 02:42:43 PM
Please see this jsFiddle (link to model is download link of the above attachment - teapot exported with mesh-optimizer):

http://jsfiddle.net/2w9Lkjbm/10/
28th April 2017 - 10:48:28 PM
Try this step by step:

1. Export from 3ds-Max with the settings attached in image.
2. Check if normals count is zero.
3. Optional: You can too remove normals in Properties->Remove->Normals. If this options does not show, it geometry not contains normals.
3ds-max-no-normals
sea3d-studio-no-normals
Download teapot-no-normals.sea 4.88 kB | Open with SEA3D Studio
29th April 2017 - 05:28:22 AM
Why there are so many visible seams on the model? Any way to avoid that?
30th April 2017 - 12:29:07 AM
Why there are so many visible seams on the model?

Not with an optimized geometry(THREE.BufferGeometry) as is in SEA3D. All geometries is converted to BufferGeometry(DirectGeometry) in Three.JS that is the standard to read in GPU. Create other sub-format to use geometry in SEA3D it is possible but it in no way is recommended to runtime(game-engine) geometry only to softwares of mesh modeling(3dsMax,Blender,etc). The performance is the main to be prejudiced. To reduce the file size is need use others algorithms as Open3DGC and LZMA(Native in SEA3D).

Any way to avoid that?

Currently if remove UV(SEA3D Exporter->Texture Coordinates would remove the seams.
30th April 2017 - 07:10:31 AM
Why there are so many visible seams on the model? Any way to avoid that?


For best results the SMOOTHING GROUPS must be exported.
For example, I use geometry.computeVertexNormals(); for this low-poly JSON model:
http://necromanthus.com/Test/html5/ptess.html
30th April 2017 - 07:20:52 AM
Currently if remove UV(SEA3D Exporter->Texture Coordinates would remove the seams.


If you remove the UV, you remove the smoothing groups.


the purpose of not export normals from beginning is it will decrease a lot in file size


Don't expect the best results if you do that.
Also, this is not an option for complex scenes.
SEA3D provides a binary and compressed format, so all you need to do is to optimize your 3D world (or 3D model).
Example: http://necromanthus.com/Test/html5/SMC.html
A complete 3D world stored in a single 2.9 MB file!
30th April 2017 - 11:26:21 AM
Ok, thank you for your time @sea3d and @remus!

I'm very appreciate and respect the amount of work you did to create Sea3D format.

Help