Hard/Soft edges for smoothing

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Rahu
Posts: 0
Joined: Sun Sep 26, 2004 5:16 pm

Hard/Soft edges for smoothing

Post by Rahu » Sat Jun 04, 2005 7:12 am

I had another thread about this, but it got long and complicated :P heres pretty much what everyone agreed on in the last one.

We would like to have the option to set edges as hard/soft and have the smoothing appear in the viewport for proper tweaking. Another feature to work with this is to have autosmooth apply hard/soft attrib to edges so an autosmoothed shape can be tweaked efore a render.

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman » Sun Jun 05, 2005 2:21 am

This is true, however there is at leasy 3 places normals are generated

Mesh/DisplayList/Rendering engine (autosmoothed)

Apparently these could be unified in some areas, else youd need to add edge based smoothing to all 3 normal generation code.

- Cam

Rahu
Posts: 0
Joined: Sun Sep 26, 2004 5:16 pm

Post by Rahu » Wed Jun 15, 2005 6:53 pm

Sorry this reply took so long, didn't notice anyone replied in the first place :P

I'm not much of a 3d coding guy, but I don't see how this would be much different to make than the current face-based system. It would just allow faces next to each other be smoothed to other faces, but not to each other, which I assume is where the trickery comes in.

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman » Fri Jun 17, 2005 12:38 pm

Good Edge based smoothing would be realy slow unless you have a format that stores which faces are next to each other, faces sharing edges, faces sharing verts etc.

At the moment Blender dosent store this data, so edge based smoothing would be slow since it would have to generate that data on the fly.

Aparently zr was a python implimentation of a topographical mesh datastructure that he may add into blender?? So if this was done Edge based smoothing would be possible

Smoothing groups is the 2nd best option, and would be fairly easy to add.
anyone for smoothing groups?

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo » Fri Jun 17, 2005 1:01 pm

smoothing groups would be better than the current solution but the workflow is much worse than having the possibility to just make edges hard and soft.

i think edge based smoothing should be implemented for the he-mesh. its data structures contain the needed stuff, right?

fearandloathing
Posts: 0
Joined: Thu Jun 16, 2005 2:00 pm

Post by fearandloathing » Fri Jun 17, 2005 3:10 pm

Manual control over vertex normals is absolutely essential for game development, I was quite shocked to learn that blender didn't have smoothing groups (setting hardness per edge is the better way to go though).
It might be more fun to write a softbody dynamics engine, but manual vertex normals editing is a must-have for any modern 3d package, far more important than softbody dynamics.

Some might argue that since normal maps are becoming the new standard, smoothing groups aren't that important any more.
That's not true, you still need manual control over vertex normals, especially if you plan to use blender for creating mods for contemporary games/game engines like Enemy Territory (ok perhaps it's outdated, but the game is far from dead).

I don't want to come off like I'm demanding the coders to serve me with features, if it weren't for my non-existant programming skills I would have contributed to the blender with code (and vertex normals editing would have been the first thing to contribute), but I'm finding other ways to contribue, I'm sketching up a tutorial on different styles of character rigs right now, and I'm thinking about doing some presets for reference for an eventual rigging script (the actual scripting will have to be done by someone else though).
I'll stop ranting now.

Pierre-Luc_Auclair
Posts: 0
Joined: Tue Nov 23, 2004 1:57 am
Location: Quebec City, Canada
Contact:

Post by Pierre-Luc_Auclair » Sat Jun 18, 2005 12:00 am

ideasman wrote:Good Edge based smoothing would be realy slow unless you have a format that stores which faces are next to each other, faces sharing edges, faces sharing verts etc.
I don't think it would be really slow. It's just a open edge with vertex normals not facing the same way..

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman » Sat Jun 18, 2005 2:43 am

Pierre-Luc_Auclair wrote:
ideasman wrote:Good Edge based smoothing would be realy slow unless you have a format that stores which faces are next to each other, faces sharing edges, faces sharing verts etc.
I don't think it would be really slow. It's just a open edge with vertex normals not facing the same way..
Could you please write up a detailed description of how it would work?
If it is not too hard I could get a patch made up.

Pierre-Luc_Auclair
Posts: 0
Joined: Tue Nov 23, 2004 1:57 am
Location: Quebec City, Canada
Contact:

Post by Pierre-Luc_Auclair » Sat Jun 18, 2005 6:57 am

I'm pretty sure it would require adding access to vertex normals on meshes.

Well, not really. Here's how it's done (there may be other ways of doing this but to me it's just logical, and what I've found was along those lines):

Image

Basically how I see it you have to split the edges you want hard to have 2 normals to break the smoothing.

Brandano
Posts: 0
Joined: Mon Apr 19, 2004 6:03 pm

Post by Brandano » Sat Jun 18, 2005 3:00 pm

I was already thinking about doing this through python before 2.37 came out, but never had time to actually getting down to do that. On top of it Blender comes to your help by having the 'remove doubles' option to weld back edges if you messed up. I was also thinking about a method to edit vertex normals manually, but that requires to be able to select a vertex without being in edit mode, as Blender recalculates normals whenever the mesh is in edit mode and all changes would be lost. I'll give it some tought but I am extraordinarily lazy, so don't expect anything in a short time.

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Sat Jun 18, 2005 3:39 pm

Pierre-Luc_Auclair wrote:I'm pretty sure it would require adding access to vertex normals on meshes.

Well, not really. Here's how it's done (there may be other ways of doing this but to me it's just logical, and what I've found was along those lines):

Image

Basically how I see it you have to split the edges you want hard to have 2 normals to break the smoothing.
When you split off vert 10 from vert 6, how do you know which face uses which?

note: I already have a method to do it, but it requires more data that the current mesh structure doesn't have. I have a py wrapper on NMesh that can generate that kind of data and easily do that kind of think in a timely maner, but generating the data is quite slow.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

fobsta
Posts: 0
Joined: Sat Jun 12, 2004 11:21 pm

Maya Polygon Soften/Hard edge workflow

Post by fobsta » Sat Jun 18, 2005 5:43 pm

Maya has a really simple workflow to set the shading angle for polygon edges.

Image

Looking at the image from left to right

The poly mesh has the centre edge selected and the user has called up the 'Polygon Soften/Harden Edge Options' box. It is awaiting user input.

The L shaped mesh in the middle has had it's centre edge shading angle set to 180 degrees. The transition shading from one right angled poly to the next is very smooth.

The last mesh has had it's centre edge shading angle set to 0 degrees
. The transition shading from one right angled poly to the next is very abrupt.

Not wanting to start a flame war but in my humble opinion this workflow is much more elegant and flexible than 3DS Max's smoothing groups.

cheers

Pierre-Luc_Auclair
Posts: 0
Joined: Tue Nov 23, 2004 1:57 am
Location: Quebec City, Canada
Contact:

Post by Pierre-Luc_Auclair » Sat Jun 18, 2005 7:54 pm

theeth wrote:When you split off vert 10 from vert 6, how do you know which face uses which?

Martin
It's not important because it is "virtually" the same vertex. When editing they both act as one. The most important thing with hard edges is to keep editability. (is it what you meant?)

Branando:
I guess that to implement normals editing, you would have to have a "set" or "unset" property on each normal. When the recalculation would go over the mesh it would skip the "set" normals. So I also guess that it would require some messing with the normals/smoothing code.

fobsta:
Sorry to say that, but I don't think this is what we should target for a good hard edges (or normal editing) implementation. The threshold method is not really appropriate for production level work IMHO.

-efbie-
Posts: 0
Joined: Wed Oct 27, 2004 9:47 pm

Post by -efbie- » Sat Jun 18, 2005 10:19 pm

the main coding problem with manual vertex normal is to determine a good space to describe their orientation.

Pierre-Luc_Auclair
Posts: 0
Joined: Tue Nov 23, 2004 1:57 am
Location: Quebec City, Canada
Contact:

Post by Pierre-Luc_Auclair » Sat Jun 18, 2005 11:32 pm

-efbie- wrote:the main coding problem with manual vertex normal is to determine a good space to describe their orientation.
Must be object or tangent I guess. Tangent is more powerful though(and I guess more complex), and could be resused directly for normal maps display. But I think you can convert object<=>tangent..

Post Reply