View Full Version : re: SDS attn: NEWTEK PROGRAMMERS sub: NO EXCUSES!

jin choung
03-20-2004, 03:34 AM

well, been doing a lot of research on the web lately on subdivision surfaces/edge weights/texturing, not just in regards to lw but other apps and with an eye on a RENDERMAN destination.

first thing i noticed is how stunningly little notice is given to subdivision uv mapping distortion! whether you're in maya or xsi or wherever, NOBODY talks about it!

there IS an article inside of maya on-line docs that tells you how to get around the problem but it involves their hierarchical SDS which ends up being painfully slow in maya proper and not supported in renderman at all.

anyhoo, i found THE BIBLE on what this implementation should be and dang it if it ain't from the dudes who created the whole thing in the first place.

http://www.cs.rutgers.edu/~decarlo/readings/derose98.pdf (with purty pictures) (google's html version)

anyhoo, all the math is here... all the logic is here... only thing not here is line by line code... pick up any monkey from a computer science department if you need an extra hand and you're golden.

but basically, you guys find out if this is patented. i don't think it is but you guys should probably have your lawyers do a once over.

if it's not patented...

DO IT! This. Exactly. Don't have to even fuss n' muss with r&d... just do this and we're good.


aqsis is a free renderman renderer... you can check that badboy so that the final implementation can export nicely to RM.

FYI, the current real time (tab) sds that we have seems not to be catmull-clark. it keeps triangles as triangles and results in pinching and seaming that is not evident in catmull clark. in contrast, metaform and the legacy metaform plus implementations of subdivision DO seem to quad everything in the first iteration just like C-C.


jin choung
03-20-2004, 03:58 AM
re: subdivision surface uv mapping....

the concept of edge boundaries being assumed as being infinitely sharp and the notion of 'SCALAR FIELDS' seems to be the essence of the solution to distortion.

not sure if i understand that the infinitely sharp boundaries for 'pieces' in uvspace can solve the problem but i can at least get my head around the general notion.

have no idea what the hell scalar fields refers to. did some googling and it turns out that it can be related to the notion of a 'marching cubes' algorithm and it seems that it plays a large part in a great deal of interpolated surfaces.... but then what specifically it is supposed to do to alleviate the problem in uv space escapes me.



03-20-2004, 06:04 AM
HI Jin,

you seem to be very aware of Catmull Clark algorithms and the like...i'm far from having so many answer to your investigations that i find very inetersting...about the triangulating thing just 2 ideas come to me since i am both a LW and Maya modeler....in Maya i use very often the Nurbs surfaces tools and just as a brainstomr there are a couple of things that comes to me that could help you (or not)

first of all as you might know Nurbs surfaces come with their UV sets...second is that there is a shift between the hulls (cv's) and the isoparms on the surface...reminds me of the shift between the poly cage and the subdivided mesh...the big differnece is that when you are working on Nurbs what you see is what you get since you are not editing the cage (like in dubdivs) but editing the surface and then the hulls are shifted to match the edition (we could say that is the exact opposite of the subdiv workflow and this is why it is prefered for accurate modeling since you donc have to guess what you will have once smoothed)

about the pinches on the subdivision cages it really reminds me of a 5 patches Nurbs stitching problem (5edges coming to 1 point also know as extraordinary vertices in subdiv) ...where instead of having a C2 (curvature) continuity you optain "only" a C 1 tangency continuity....

i think that Catmull Clark algorithm is a kind of reverse Nurbs ...the only problem (that doesn't exist in real Nurbs) is that the subdivision process takes every point in consideration instead of having what in Nurbs would be a multiknots (2 points in the same place) that keeps the boundary from shrinking (here also comes the UV distortion) .... in the other hand having 2 points in the same place (wich we do commonly by spliting or bandsawing close to the boundaries to stop shrinking) will be not compatible with other poly operation (merge) that allows us to obtain a seamless mesh ,wich is needed for other operations like skinning (reason why Nurbs are a pain in the *** to deform corrcetly.

Nurbs are not designed to be stitched...not even attached really...the only thing that counts is curvature or tangency continuity...the amazing thing with this is that Nurbs allow differnet resolutions at different places instead of keeping all stitched

as a conclusion i do think that LW subdivs are Catmull Clark (i cant see what else it could be) but there is certainly a trick in the way those are calculated (that allowed the phantom points for example) this "special" implementation explains (i dont know why or how) teh fact that tris are kept as tris ...btw notice that in Maya we still have to use a cage in subdivs to add geometry (trinagulate; split etc) we cant extrude the subdivs cage per se but we have to switch to poly mode to add geometry...wich is not the case in LW where we can extrude directly faces while in subdiv mode btw all this implementations are what makes LW subdivs so cool to use :)

03-20-2004, 06:48 AM
A while ago i started a thread about UV-s and Projections.
There i explained what i expect.
Unfortunately there was not much welcome from other users.

But still i believe this could be an universal solution in many

Actually i faked a orthogonal camera at the end by setting
camera distance very far away and zoom factor the same number.

By rendering such cameras with light incidence to get the alpha
channels i discovered this a VERY useful method of analysis.

You see at the spot where are the shortcomings with your

Maybe you guys have some solution to this: how to stick
the info to polys that comes from light incidence. The specific
is that light incidence angle determines wich side the polygon
normal is facing. So elliminating backside projection.

This method (True Cubic Mapping) elliminates also every problem
the UV-s and subdividings have, because it is straightforward.

03-20-2004, 06:56 AM
The link to the talk


03-20-2004, 09:05 AM
Lightwave does use catmull-clark sub-d surfaces.

I'm not sure why lightwave doesn't split up n-gons ... maybe they didn't think of it ... maybe they were worried about it not working in every case ... I'm not sure. It was Fori that did it, so Maybe he could tell you why ... or maybe it's something with lightwave that is the problem (though i don't know what :\ )

The texture map thing is basically saying you subdivide the texture map the same way you subdivide the object. I think you don't subdivide the edges of your uv map though because that creates the distortions.

Arnie did all the uv map stuff in lightwave 6. There was originally alot of distortion between a subd uv map and a polygon subd map. He changed something in 6.5 or 7 to remove some of this distortion .. I forget exactly what it was though. He said that subd'ing the uv map map would be stupid though (or something like that). Maybe his fix was to subdivide the uv map but he didn't keep the edges sharp .. that would explain still having distortions. After seeing what he did with uv maps in lw 6 I have a feeling he didn't read the documents on how things work or didn't test what he'd done ...

Anyway, remember alot of Geri was modeled with Lightwave, so it can't be that bad ;)

03-20-2004, 02:32 PM
Ahhh, my fav. topic. Jin, why not email Newtek tech. about that. I bet they've seen it before.
Check out this cool fix. http://www.cs.utah.edu/gdc/publications/papers/johnson99a.pdf

Allan, i also thought that. It would be great if there was a normal mapping option that adjusted the angle of the pixels projected to that of each pol's normal direction, there by eliminating the stretching on the angles. Then have it stick, and rotate it. Like a 3d paint viewport. :eek:

03-20-2004, 06:43 PM
JDaniel ... I'm sort of confused about what you're saying. If you want to stick a planer projection on and object and you want the polys to stick to each polys normal projection ... well the way I think you're thinking of that is impossible, and how they map now is the polys being applied to each polys normal.

If you mean you want what allankiipli described but from as many angles as you want, I think Animation master has something like that, and it'd be a nice addition to lightwave. I don't think it'd be too hard to set up a mapping type like this. allankiipli's idea introduces alot of distortion for even mildly complex objects however and it wont map as well as you think.

03-20-2004, 09:05 PM
If you can download the divx. The video shows you what I'm talking about. http://www.cs.princeton.edu/gfx/proj/wnpr/
The artist chooses a brush, then draws strokes over the model from one or more viewports. When the system renders the scene from any new viewpoint, it adapts the number and placement of the strokes appropriately to maintain the original look.
The video shows stylized strokes but you can imagine how you could use.

03-20-2004, 09:40 PM
Ahh jot. I'm not 100% sure but something like shown in that video would only work well with npr stuff. It'd still work with realistic stuff but I think it'd cause problems.

jin choung
03-21-2004, 12:50 AM
hi guys,

first of all:

No, i don't think lw uses catmull-clark. as i said, catmull clark becomes a mesh of ALL QUADS on the first iteration. and the final subdivided surface consists of only quads.

you get this with metaform and metaform plus AND the results are the same as pixar examples.

but with lw's sds, quad parts of the cage are resolved into quads... triangles are subdivided into MORE TRIANGLES.

there are MANY MANY MANY different subdivision algorithms. DOO-SABIN is another, BUTTERFLY is yet another. catmull-clark is not at all the only possibility. my guess is that lw's is a homebrewed variation. and i would bet that this is the case for C4D as well and any other app that does not explicitly advertise C-C or 'pixar subdivision surfaces'.

it may be SIMILAR but let's not confuse that by saying that it's the same thing already - we're talking about technicalities so let us be precise eh? the RESULTS ARE DIFFERENT.

for doubters, TAB and freeze a mesh composed of quads AND tris. then take the same base cage and metaform it. NOT THE SAME RESULTS.


this is just my opinion so take it for what it's worth, but i'm not gonna sugar coat this - i don't think yours is a good idea and i'll tell you why:

no other software uses that method. and perhaps more importantly, RENDERMAN doesn't use that method.

as it pertains to the merits of your solution, as MK3, told you in the other thread, it's ALREADY POSSIBLE if you use lw's legacy projections on your model... it will project your texture using an 'orthographic' projection. and again, as MK3 said, you can blend between the projections with 'ALPHA MAPS'.

this is ALREADY a method to avoid the distortion. but the problem is that such a method does not give you an easily generated PAINTING TEMPLATE and nobody else uses this method to texture SDS.

and further, the IDEAL solution for this is NOT just a method that works well inside of lw and for lw but conforms to STANDARDS such that it is easy to go back and forth between different modeling/animating/rendering applications.

and inasmuch as interfacing with RENDERMAN is a big part of most professional film work (hence, THE STANDARD), we should aim towards making such an interface seamless.


hey, and i'm not saying i'm a rocket scientist either. i'm just pointing to this paper that basically tells you EXACTLY HOW THEY DO IT with all the math and academics explained by the people who CAME UP WITH ALL OF THIS IN THE FIRST PLACE.

i'm saying, if anyone should know, THEY WOULD. and further, the information is freely available. IF IT IS NOT PATENTED OR RESTRICTED, LET'S JUST COPY THAT!

and sailor,

yah, i'm familiar with NURBS... they're great for non deforming, ID kinda forms where need multiple curving shapes that flow together but don't want their CONTROL CAGES to interfere with each other. i think car chassis are IDEAL for NURBS.

but i can't imagine why in the world anyone would choose to make CHARACTERS with nurbs... that's just insanity in my book.


yep, our favorite topic... surprised how little this is discussed in other circles!


jin choung
03-21-2004, 12:55 AM
hey jdaniels,

also, re: the pdf link, that article seems to talk about haptic interface for painting textures but that's hella overkill!

actually, even with just 3d painting - anything where you paint directly on the mesh - you get the same kinda thing... that is, no matter how messed up your uv map is, everything will be 'counter distorted' to match what you're drawing on the mesh.


03-21-2004, 05:01 AM
Jin choung, Catmull-Clark isn't exact, there's no specific way to do it, it's just a method of subdividing a mesh, and lightwaves subd surfaces do the same thing. However, as the C-C method in the pdf has an exception for non-quads, as does lightwaves, they are just different. You could argue that metform isn't C-C too as it doesn't make polygons with 5or more sides into quads, but it's still using the C-C method.

Also, the difference between how Jot does it's painting and how 3d paint programs work is with juot you're just drawing a line, so it'll never get distorted. The problem with this however is that when you use more strokes the rendering gets very slow.

03-21-2004, 06:21 AM
The only thing i want is a little checkbox nearby to tell Lightwave
to stick lightderived incidence to the polys the same way the
projection becomes sticked.

Or even better: To have checkbox to tell: Project only facing

Thats all i want.

03-21-2004, 06:46 AM
Once you've finished texturing, create a uv map .. atlas would be best for you as it's automatic. Then add the surface baker plugin and bake your textures to the uv map.

03-21-2004, 07:20 AM
i did it and the result was bad comparing to unmodifyed setup

03-21-2004, 07:39 AM
How was it bad? You should make it high res .... 4 times whatever each of your cubic images was. Also only bake the colour, nothing else. It should look fine ... tell me why it looks bad and maybe I can help.

03-21-2004, 10:09 AM
Hey, that's sort of my workaround tech. I wrote. :D
Jin, I'm using your thread again...
Allan,Karma, if you parent the cam to a null,pull the cam out/zoom in, you can rotate the null, giving the illusion of a rotating object. This let's you use the fixed projection for maps. Use an alpha/fixed projection on frame 1/keyframe/rotate and repeat. Except enter next time frame on 2 for the next projection, etc. When finished bake to final image. I already asked Worley about adding a baker to FPrime. ;)

03-21-2004, 10:48 AM
I added some images to the thread About UV-s and Projections.

It looks not bad but less good.

Also the least resolution is unlike to manipulate unless on a fast

JDaniel, if i bend my object with bones, Light angles go all around.
But sort of painting thingy i imagined also.

03-21-2004, 11:59 AM
I don't understand.

03-21-2004, 12:36 PM
But i didnt understand you.

My problem is that when i use light incidence angle as my
gradient input parameter (to achieve balance between projections). I cannot deform my object.
The idea behind this cubic mapping was to precisely determine
the facing ratio of a polygon. This can currently
be done only with distance lights.

We might have sort of input parameter for gradient:
Facing ratio to X Y Z, and r e v e r s e for them (to achieve -Z -Y -Z).

But when i deform my object or rotate it , the angles of lights
change. When the object is static, lights could be parented to the object.

Or of what you was talking?

03-21-2004, 12:43 PM
Oh i understand now.

I did following,





in modeler to create boundingbox, unwelded the box, smootshifted, flipped. Turned faces into luxigons.

Same might be done for cameras.

jin choung
03-21-2004, 06:39 PM
Originally posted by Karmacop
Jin choung, Catmull-Clark isn't exact, there's no specific way to do it, it's just a method of subdividing a mesh, and lightwaves subd surfaces do the same thing. However, as the C-C method in the pdf has an exception for non-quads, as does lightwaves, they are just different. You could argue that metform isn't C-C too as it doesn't make polygons with 5or more sides into quads, but it's still using the C-C method.

hey karmacop, according to what you're saying then, there is no difference between c-c and doo-sabin or butterfly... after all, they're ALL just methods of subdividing a mesh, right?

i don't think that's right. c-c is not equivalent with the very CONCEPT of subdivision surface. it is a specific variant with specific attributes. just as doo-sabin has specific attributes and the butterfly technique has specific attributes.

not all subdivision surfaces are by definition c-c! read the link that i put up. it seems to me that the specifics of what c-c is is spelled out pretty unambiguously.

and that hollowed out pyramid shape near the beginning of the pdf, if you hit tab in lw on that control cage, you get a pinchy mess. i've posted images of the differences in this forum somewhere....

finally, the crux of my argument is that ours is not as good as theirs. we should make it like theirs.


03-21-2004, 09:07 PM
You're not listening Jin ;)

This is very simple, but ...
Catmull Clark use the midpoints of quads.
Doo-Sabin uses edges
butterfly uses triangles

The math may be a little bit different, and it handles extraordinary points and boundries differently but it's still a catmull clark function.

jin choung
03-22-2004, 02:55 AM
Originally posted by Karmacop

Catmull Clark use the midpoints of quads.
Doo-Sabin uses edges
butterfly uses triangles

The math may be a little bit different, and it handles extraordinary points and boundries differently


ok... WHERE are you getting your definitions? cuz if my control cage consists of nothing but TRIANGLES, then clearly your definition of catmull-clark is wrong.

WHERE are you getting your definitions that c-c is quad based, d-s is differentiated by an emphasis on edges and butterfly's has to do with triangles?

as for, "the math may be a little different"...


again, one of the properties of c-c is that after the first iteration, your subdivision mesh consists ENTIRELY OF QUADS. if that is not true, how can you be confident that it STILL IS?

i say that such differences mean that it is no longer c-c because c-c is defined by very specific math. you say that little deviations from that math doesn't matter... why???

it may be LITTLE DIFFERENCES but little differences define distinctions between LOTS OF THINGS.

if A = B, then B + 1 is not automatically A because it's CLOSE ENOUGH! there is a DEFINITION that we're talking about here.

"Catmull and Clark [2] introduced one of the first subdivision
schemes. Their method begins with an arbitrary polyhedron called
the control mesh. The control mesh, denoted M0 (see Figure 3(a)),
is subdivided to produce the mesh M1 (shown in Figure 3(b)) by
splitting each face into a collection of quadrilateral subfaces. A
face having n edges is split into n quadrilaterals. The vertices of
M1 are computed using certain weighted averages as detailed below.
The same subdivision procedure is used again on M1 to produce
the mesh M2 shown in Figure 3(c). The subdivision surface is
defined to be the limit of the sequence of meshes M0"

that's from the first pdf i cited. that is a definition. if you don't do that... EXACTLY, you're not c-c.

so where are you getting your information?

here's where i'm getting some of mine.



and in this last piece, if you're saying doo-sabin is edge based, butterfly is triangle, then what are all the other variations working off of? you only have so many geometry components.

to me, it totally seems like you're calling a ferret a weasel or a wolverine a weasel because it's close enough...




03-22-2004, 04:14 AM

Maybe you're not big into math Jin. y=x^2 is a parabola right? So is y=(2x)^2. So is y=x^2 + 13x + 12. They are all parabolas, even though they are different.

Catmull-Clark is just a method. I'd be suprised if anyone other than pixer used the exact method stated in the pdf. The only thing Lightwave's version does differently is how is handles the extraordinary points.

Now, if you look at page 2 you might see where it says "This paper describes a number of issues that arose when we
added a variant of Catmull-Clark [2] subdivision surfaces to our animation and rendering systems ...". Notice how it says varient. This is because catmull-Clark is just a method, not a locked down exact way of doing something.

As for the other methods of sub-d surfaces, I told you I was only giving simple definitions. The first pdf you posted gave similar definitions. It says "Whereas Catmull-Clark subdivision is based on quadrilaterals, Loop’s surfaces [11] and the Butterfly scheme [6] are based on triangles." Ofcourse there's more features that make these methods different but they are very simple definitions for them.

jin choung
03-22-2004, 05:04 AM
you keep saying things that are patently WRONG! and you keep saying them soooo authoritatively....

the only thing that is different is NOT how they handle extraordinary points!!! as i KEEP KEEP KEEP KEEP saying, after the FIRST ITERATION, C-C RESULTS IN A MESH THAT IS ALL QUADS!!! lw's KEEPS TRIANGLES IN THE FINAL MESH!!!

if your control cage consists of triangles en toto or in part, this results in VERY DIFFERENT LIMIT SURFACES!!!









jin choung
03-22-2004, 05:08 AM

just answer me this:

you say that lw's is C-C 'just with a little different math'.


and then, whatever your answer is - SAYS WHO?


03-22-2004, 05:29 AM
"the only thing that is different is NOT how they handle extraordinary points!!! as i KEEP KEEP KEEP KEEP saying, after the FIRST ITERATION, C-C RESULTS IN A MESH THAT IS ALL QUADS!!! lw's KEEPS TRIANGLES IN THE FINAL MESH!!!"

The triangles are the extraordinary point, yes it keeps them as triangles, this is how it treats them differently.


So then you're saying that even Pixar's Catmull-Clark varient algorithm that they describe in the pdf isn't Catmull-Clark? So then you're saying what you're asking Newtek to implement isn't true Catmull-Clark?

From http://www.scg.uwaterloo.ca/~hqle/subdivision/images/CatmullClark/CatmullClark2.html

"Catmull-Clark generalized bicubic uniform B-spline surface refinement to arbitrary topology, and define the following rules:

1. New face points: the average of all of the old points defining a face.
2. New edge points: the average of the midpoints of the old edge with the average of the two new face points of the faces sharing the edge.
3. New vertex points: Q/n+2*R/n+S(n-3)/n where Q is the average of the face points of the faces adjacent to the vertex point, R is the average of the midpoints of the edges adjacent to the vertex point, S is the corresponding vertex from the original mesh, and n the number of vertices of the face under consideration.

After these points have been computed, new edges are formed by:

1. connecting each new face point to the new edge points of the edges defining the old face.
2. connecting each new vertex point to the new edge points of all old edges incident on the old vertex point."

Yes Lightwave's subd surfaces are a varient of Catmull-Clark, but so is Pixar's. I don't know why you're getting so angry man, jusy calm down.

jin choung
03-22-2004, 06:17 AM

technically, i am asking newtek to implement the PIXAR VARIANT OF C-C that enables the weighting of edges and verts.

that is technically what i am saying. but in order to do the above, they would have to implement C-C first to build on! and actually, what i'm saying is that let's just get C-C FIRST! cuz our surfaces don't even look THAT GOOD!

i'm not exactly getting angry... just exasperated.

i'm asking for newtek to make our sds better because they're not good now. i'm saying let's make it like c-c as our metaform seems to be because it produces superior surfaces.

but then you come in and say that WE HAVE C-C! it's C-C already!

not only is that not strictly true, but it doesn't in anyway contribute to the exhortation in a productive way. do you not want our surfaces to look as good as pixar's? can you not see a difference?

yes, they're all parabolas, but not all parabolas overlap the same points. yes, they're all dogs but not all dogs are the same breed. yes, they're all subdivision surfaces but not all subdivision surfaces are the same. ESPECIALLY WHEN THEY DON'T EVEN LOOK THAT MUCH ALIKE! and ours has significant problems.

the thing that really bugs me is that c-c is defined as a list of characteristics A, B, C, D, E, etc.

you seem to have locked on to maybe A and B as being the DEFINING CHARACTERISTICS of what makes C-C... and it seems to come from NOWHERE! it seems like you completely arbitrarily DECIDED that only A and B were the really important parts of the definition.

what i keep boggling over is why, in your opinion, are not C, D and E JUST AS IMPORTANT in defining what C-C is.... why is the fact that triangles are subdivided into more triangles not a DEFINING DIFFERENCE?

again, how different does the math have to be in order for it to become something different and who determined where that line is?

it's the seeming arbitrariness in your classifications that really have me pulling my shaved hairs out....

but it's probably just a difference in personality. you probably can't begin to understand what my problem is whereas part of my frustration comes from the fact that i can't comprehend how such precision is not important to you.


p.s. my apologies on the tirade about triangles... you are entirely right that the difference is how lw handles extraordinary points. for some reason, i read that as 'pole points' and what i thought of as pole points was entirely wrong. you are completely right that the difference is how lw handles extraordinary points in the control cage and as such, you were completely right be authoritative on that.

03-22-2004, 06:46 AM
Don't get me wrong Jin, I would love for Lw's sds to work the same way as shown in that pdf. We do have C-C. If you subd an all quads object in lightwave you get an object very similar, if not the same to what you'd get with Pixar's (I think Lightwave's has a base weight to make the subd object closer to the original). The only difference is when you bring 3 sided polygons in (which uses some different method) and when there's an ngon (I think they left ngons out because they are unpredicatable when concave).

I understand what you're saying Jin, don't worry about that, and I wish for the same thing. All I was pointing out is that we have C-C surfaces, but I guess you'd call it a limited subset of Pixar's version.

I'm not being imprecise, I bet if you saw Lightwave's version it'd be nearly the same algorythm except with maybe a x2 or +5 somewhere in there.

Anyway, at the moment I'm trying to get subd working in Lscript. It'll just be a modeling script but it'll turn everything to quads etc. I've nade alot of progress with it in one day considering how mush I've had to learn ... but with uni I may not have something to show too soon, but I guess we'll see.

03-22-2004, 08:56 AM
Has anyone emailed Newtek, or had a response about this? We've only been talking about it forever. I wonder how Modo will handle uv's/subd's?

03-22-2004, 08:58 AM
Modo will let you define yoru own subd methods. I haven't had a response from newtek, but I'm hoping they've made the code more modular as in 8 it's sort of a display function from what I understand ...

jin choung
03-22-2004, 11:45 PM

i emailed newtek as i started the thread. no response but wasn't expecting one.

they have been notified and therefore, no excuses.