T-Junctions re-visited


Re: T-Junctions re-visited
#50
Hi Travis,

Here's another possible META command to help solve the T-junction performance problem: sub-part smoothing hints.

The meta command would categorize a part, sub-part, or primitive into one of three categories:

SMOOTH - the part needs to be smoothed in the context of its neighbors. A torus quarter would need this since it must be smoothed against the rest of a minifig head. This is the most expensive smoothing because smoothing must be done on the larger structure, not the sub-part or primitive. This is the default for non-anotated parts.
FLAT - the part does not need any smoothing because it's all angular. The part also does not need to be smoothed against other parts near it. The part can be excempt from the smoothing of those who contain it.
SMOOTH_ATOMIC - the part needs to be smoothed against itself, but does not create smooth contours with other parts. The part can thus be smoothed once and then be exempted from smoothing in a parent part. Stud.dat would be in this category.

Looking at our friend the 48x48 base-plate, if studs are marked smooth-atomic, then the baseplate is trivially cheap to smooth. :-)

These meta directives of course can be ignored; the FLAT hint is not meant to ensure flat smoothing of a round surface - it is meant to allow a program that supports smoothing to skip it; putting the FLAT smoothing meta tag on a minifig head would be an authoring error.

The idea here is that by breaking out the sub-parts and primitives that are self contained and/or angular relative to other parts, we can cut the amount of 'stuff' in the expensive smooth calculations, which aren't going to get any better than O(NlogN) under ideal circumstances.

What's good about this proposal is:
- It isn't required - we can apply it tactically on a few parts to get some of the biggest problem pieces to be faster. Just marking stud.dat as smooth atomic and a few of the box primitives as flat will make a big difference.
- It doesn't require analysis of the part itself - a human can look at the part, go "that's a box", apply the META, and go home happy...no geometry required.

What is not so good is that it is only useful if smoothing can be applied iteratively during part constructoin. This is currently not true for BrickSmith (I smooth after Allen flattens the parts) but it wouldn't be a hard refactor, and it would be worth the perf win.

Also this proposal totally ignores the problems of T junctions when smooth shading is not desired. Technically if we wanted a 'water tight' baseplate, in OpenGL, we'd have to subdivide the top face of the baseplate itself at every stud and re-triangulate. I am pretty sure we do not want to do that... :-) So the spec intentionally doesn't try to solve T's unless smoothing is desired.

Finally, I am hoping to get a T-finding algo written some time in the next week or two to get some 'real' performance numbers, e.g. if the algo uses good search structures in a low level language, how slow is it...

Cheers
Ben
Reply
« Next Oldest | Next Newest »



Messages In This Thread
T-Junctions re-visited - by Travis Cobbs - 2013-03-12, 5:38
Re: T-Junctions re-visited - by Tim Gould - 2013-03-12, 6:31
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:17
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:32
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:55
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-13, 18:27
Re: T-Junctions re-visited - by Allen Smith - 2013-03-12, 21:01
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-13, 17:37
Re: T-Junctions re-visited - by Tim Gould - 2013-03-13, 21:31
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 15:43
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 16:02
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 14:30
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 17:57
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 18:27
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:23
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 20:41
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 21:59
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-19, 1:09
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-19, 18:43
Re: T-Junctions re-visited - by Tim Gould - 2013-03-20, 10:56
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:13
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 17:23
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:29
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:26
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 18:18
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 13:42
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 13:58
Re: T-Junctions re-visited - by Allen Smith - 2013-03-20, 16:08
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 18:50
Re: T-Junctions re-visited - by Tim Gould - 2013-03-13, 22:56
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-13, 22:51
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 0:10
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 3:17
Re: T-Junctions re-visited - by Tim Gould - 2013-03-15, 3:41
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 17:56
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 1:58
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 2:37
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 3:18
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-14, 22:23
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 22:41
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 2:43
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 3:18
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 3:15
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-15, 19:27
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-16, 0:08
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 15:58
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:28
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:32
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-26, 21:46
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-27, 20:48

Forum Jump:


Users browsing this thread: 2 Guest(s)