Home › Forums › Graphics / Blender › Workflow for cutting holes in geometry and preserving normals
- This topic has 23 replies, 4 voices, and was last updated 5 years ago by Yuri Kovelenov.
-
AuthorPosts
-
2019-08-28 at 11:43 am #18188D3PixelCustomer
Hi
I am finding it difficult working with Verge3D when it comes to creating holes in curved geometry without really bad normals.
My usual workflow is to bevel a vertex, subdivide twice and then use LoopTools->circle to create a nice low poly circle in the geometry that I can then extrude inwards. After that I bevel the lip and set the inner bevel edge to Sharp.
If there are any shading defects I can either transfer the Normals from another datablock or just copy/paste vectors from neighbouring faces.In Eevee this always results in great cut holes with correct normals and shading but when exporting to Verge3D they are 99% a mess. This is taking so much time trying to figure out a workflow that works in both Eevee and Verge3D.
Sorting elements by Z axis will show what Verge3D sees but sometimes even this looks fine in Blender but not in Verge3D.
I have also tried shrinkwraping vertices to a pre-hole copy of the mesh without success.
If anybody has a correct way to cut holes in geometry and keep smooth shading across faces then please let me know as this is driving me potty.
Thanks
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-28 at 11:54 am #18193Mikhail LuzyaninStaffI think the model has n-gons that will be converted to triangles after the export to the engine. So to get the same result convert them to triangles by yourself and will get the same result (usually awful) in Verge3D and Blender. Try to use endge split on holes after that to get better result.
Co-founder and lead graphics specialist at Soft8Soft.
2019-08-28 at 12:04 pm #18195D3PixelCustomerI will try edge split, cheers.
I can solve it by creating a bevel with more than 1 segment, e.g. 3 and set the profile weight to 1.00 but of course this creates more geometry.
I will try edge split too but often avoid splitting as it breaks a water tight mesh.
Thanks for the help.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-28 at 12:32 pm #18198Mikhail LuzyaninStaffI mean not a modifyer Edge Split but use edge split tool that marks that adges to split and then use autosmooth option (in mesh preferences) with 180 degreese to avoid unexpected seams.
Co-founder and lead graphics specialist at Soft8Soft.
2019-08-28 at 1:55 pm #18206D3PixelCustomerI will try that too, thanks.
Is 3DS Max better at this than Blender 2.8?
I know max has assignable smoothing groups that Blender does not and a Unify Normals tool but my max subs ran out so can’t compare the two.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-28 at 5:48 pm #18215Mikhail LuzyaninStaffSmoothing groups (3ds max) and Autosmooth (Blender) with Enge Split are the same things. They differ only in process of how do you prepear them. Blender’s aoutosmooth more flexable in my opinion because you set not a groups that must be separated in shading but an edges that must be splited, so you can keep all mesh as one smooth group and split only some of it’s edges. As I can understand Unify Normal tool just rotate all normals in one direction, isn’t it? In blender you just can type ctlr+n for that.
Co-founder and lead graphics specialist at Soft8Soft.
2019-08-29 at 12:06 am #18219D3PixelCustomerWith Blender 2.8 (edit mode, not the modifier) Edge split separates the edge by detaching it so if you split an edge around a quad then that quad face can be lifted off the mesh thus breaking the watertightness of a mesh. Also, when merging vertices in cleanup operations this will re-weld those loose edge vertices.
I think you may be referring to Mark Sharp and Clear Sharp features for editing edges which works with Normal Auto Smooth.
https://docs.blender.org/manual/en/2.80/modeling/meshes/editing/edges.html?I just discovered there is also a mesh->Normals->Split command that enables custom normals shading (with Auto Smooth) but disables the Angle limit, this does not break vertices and has a companion modifier called “Normal Edit” and seems to be for game designers. I will give this a play with tomorrow
https://docs.blender.org/manual/en/2.80/modeling/meshes/structure.html#custom-split-normalsControl N is a 2.7 hotkey. I think it is now Recalculate Outside / Inside in 2.8 (via Alt+N) but that rarely helps when trying to fix normals that do not shade well in Verge, it does help if you are trying to create transparent materials I found.
As for the differences between Max and Blender, yes I see what you mean. Cheers.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-29 at 5:34 am #18227Mikhail LuzyaninStaffI think you may be referring to Mark Sharp and Clear Sharp features for editing edges which works with Normal Auto Smooth.
https://docs.blender.org/manual/en/2.80/modeling/meshes/editing/edges.html?Yes, I mean this thing.
I just discovered there is also a mesh->Normals->Split command that enables custom normals shading (with Auto Smooth) but disables the Angle limit, this does not break vertices and has a companion modifier called “Normal Edit” and seems to be for game designers. I will give this a play with tomorrow
https://docs.blender.org/manual/en/2.80/modeling/meshes/structure.html#custom-split-normalsYes, custom normals also will be good solution but will take more time to deal with them.
Control N is a 2.7 hotkey. I think it is now Recalculate Outside / Inside in 2.8 (via Alt+N) but that rarely helps when trying to fix normals that do not shade well in Verge, it does help if you are trying to create transparent materials I found.
If your normals has different direction it will laso help to unify them on one, that Unify Normals (3ds Max) tool do I think.
Co-founder and lead graphics specialist at Soft8Soft.
2019-08-29 at 12:17 pm #18243D3PixelCustomerUrgh, I give up. I have spent 5 days on this.
I think that the Verge3D / Blender 2.8 gltf 2.0 exporter is ignoring custom normals.
Workflow
1. Create a cylinder 01
2. Duplicate it and hide cylinder 02
3. Punch a hole in cylinder 01
4. This has normal issues like visible edge creases due to triangulation, quads etc and is expected at this point.
5. To fix that, transfer normals from Cyl 2 to Cyl 1 to it looks perfect. Various ways to do this, I use MESHmachine stashes but you can do it manually using Data Transfer modifier.The object now has custom normals and looks clean in Eevee.
Results:
If I export this using Verge3D gltf exporter the custom normals are ignored and the resulting mesh is poor.If I import the Blend file into Unity, build a simple webgl project and compile it, the custom normals are preserved and the model looks as it should.
possible conclusions:
Blender or Verge’s version of the exporter is ignoring custom (vertex) normals.
Unity preserves custom normals either via FBX conversion or through its own import algorithms and shows the webgl as it looks in Blender.Unity model import options:
Mesh compression off
Optimize mesh off
Keep quads on
Weld vertices on
Normals: Import
Normals mode: Area and angle weighted
Smoothness Source: Prefer smoothing groups
Tangents: Calculate MikktspaceThis is a shame as fixing normals in Blender just for Verge takes ages and requires lots of additional edge loops and sneak peaks as you work.
I have noticed that there are quite a few Blender bug reports about custom normals in early 2.8 branches of the Blender gLTF 2.0 exporter and these are still present when using the Blender exporter instead of Verge3D. I thought I could get around this by baking the normal maps but Blender Cycles would not bake the custom normals either.
Could you please try exporting the attached Blend file to FBX/Max and then export via 3DS Max to see if it has the same shading issues?
Thanks
Attachments:
You must be logged in to view attached files.3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-29 at 1:17 pm #18251D3PixelCustomerTo further back this up, If I export the mesh to FBX and run it through a three.js converter at https://blackthread.io/gltf-converter/ it also preserves normals and looks great so this must be possible in your pipeline?
See attached image.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-29 at 1:18 pm #18253Yuri KovelenovStaff2019-08-29 at 1:34 pm #18254D3PixelCustomerThanks Yuri. I hope to sell WebGL as a part of my services and the Verge3D evaluation so far allows me to prototype faster than other solutions. I hope you find a way (or get Blender.org involved) to solve this soon.
Cheers
Geoff3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-30 at 6:07 am #18274Mikhail LuzyaninStaffWe get that it’s a problem of GLTF export that triangulate all model when you export it to the engine. I hope we can fix it soon. But now you can do a trick before export: 1. Go to edit mode; 2. Choose any 4 side poligon; 3. Go to select=>select similar poligon sides; 4. Press CTRL+I to invert selection; 5. Press CTRL-T to triangilate all selected ngons.
https://youtu.be/7QELW3lYADcCo-founder and lead graphics specialist at Soft8Soft.
2019-08-30 at 11:58 am #18285D3PixelCustomerHi Mikhail
Thanks for the reply.
I have looked at your method and although it helps it also makes the mesh unworkable due to having to triangulate. More complex geometry does not always work this way too and triangulated meshes can still look ok in Blender but render incorrectly in Verge.
However, I have found a solution now that appears to fix custom normal exports.
Workflow:
1. Create Cyl, duplicate it for normal transfer later, hide duplicate
2. Cut hole in Cyl, bevel, whatever you want.
3. When finished with edits perform a normal transfers from copy in step #1 to fix all normal shading issues.
4. Add a “Triangulate modifier” to the mesh and tick “Keep Normals” <– that is key
5. Now Sneak Peak it and it will look the same as in Blender.This is also a non-destructive workflow and allows you to see what the model would look like in Verge without exporting.
Note: Do not apply the Triangulate modifier, it will be applied on Verge export automatically thus preserving the mesh normals.
3D Animation and Web3D services - www.d3pixel.co.uk
2019-08-30 at 12:11 pm #18288D3PixelCustomerI posted an updated solution to this issue but it is not showing in the forum?
Anyway, rather than triangulate the mesh which is destructive, just apply a Triangulate modifier and tick “Keep Normals” to solve custom normals and provide a WebGL WYSIWYG of the mesh between Blender and Verge3D. No need to apply it. Works great.
3D Animation and Web3D services - www.d3pixel.co.uk
-
AuthorPosts
- You must be logged in to reply to this topic.