Workflow for cutting holes in geometry and preserving normals

Home Forums Graphics / Blender Workflow for cutting holes in geometry and preserving normals

This topic contains 23 replies, has 4 voices, and was last updated by Yuri Kovelenov Yuri Kovelenov 2 weeks, 6 days ago.

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #18188
    D3Pixel
    D3Pixel
    Licensee

    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

    • This topic was modified 1 month, 3 weeks ago by D3Pixel D3Pixel.
    Attachments:
    You must be logged in to view attached files.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #18193

    I 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.

    #18195
    D3Pixel
    D3Pixel
    Licensee

    I 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.

    Attachments:
    You must be logged in to view attached files.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #18198

    I 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.

    #18206
    D3Pixel
    D3Pixel
    Licensee

    I 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.

    • This reply was modified 1 month, 3 weeks ago by D3Pixel D3Pixel.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #18215

    Smoothing 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.

    #18219
    D3Pixel
    D3Pixel
    Licensee

    With 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-normals

    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.

    As for the differences between Max and Blender, yes I see what you mean. Cheers.

    • This reply was modified 1 month, 3 weeks ago by D3Pixel D3Pixel.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #18227

    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?%5B/quote%5DYes, I mean this thing.

    [quote quote=18219]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-normals%5B/quote%5DYes, custom normals also will be good solution but will take more time to deal with them.

    [quote quote=18219]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.

    #18243
    D3Pixel
    D3Pixel
    Licensee

    Urgh, I give up. I have spent 5 days on this. :cry:

    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 Mikktspace

    This 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

    #18251
    D3Pixel
    D3Pixel
    Licensee

    To 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.

    Attachments:
    You must be logged in to view attached files.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #18253
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    Thanks for pointing this out! We’ll investigate this issue and get back to you soon!

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #18254
    D3Pixel
    D3Pixel
    Licensee

    Thanks 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
    Geoff

    • This reply was modified 1 month, 3 weeks ago by D3Pixel D3Pixel.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #18274

    We 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.

    Co-founder and lead graphics specialist at Soft8Soft.

    #18285
    D3Pixel
    D3Pixel
    Licensee

    Hi 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.

    • This reply was modified 1 month, 3 weeks ago by D3Pixel D3Pixel.
    • This reply was modified 1 month, 3 weeks ago by D3Pixel D3Pixel.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #18288
    D3Pixel
    D3Pixel
    Licensee

    I 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

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic.