Micropoly Script & Tests

Let Kai port his nicely done adaptive subdivision to the modifier stack first before making him do Voxels, he can’t do 5 features at once.

Kai: porting this to C would clearly make this a lot faster, plus as a modifier, you only have to apply it to objects that need it. Don’t worry about voxels until this becomes an official feature in Blender.

CD; pot? … kettle? Black? :eek:

That’s awesome! :stuck_out_tongue:

no problem, the subdivide function takes care of UV’s.

check this example mapped with depth images: :slight_smile:

do not try this at home with your own blender, kids. :smiley:

i’ve uploaded also an updated version of the first test: micro4.avi. you’ll notice that banding is not easy to see anymore.

highres videos

about the c implementation, i’ve read throughout all new developer stuff in the wiki but many links are dead. even if i use the search function for example “coding style” it leads to the correct search result but the link brings only “Page doesn’t exist (anymore)”. someone should take care of it.
btw, the hackers guide could also be extended by an “adding a modifier” coding tutorial. :wink:
however, i’ll keep fighting with the source mess.

Kai Kostack, that video, Suzanne, is incredible. You did an awesome job with the code.

wow, banding is almost unnoticeable! looks cool, i really had to look very hard to notice them!
just out of curiosity, on your mesh under editing panel the “No v.normal flip” button is turned on by default? or did you render your examples withouth that button on? i would like to see the suzanne render with that one turned on compared with the one when it wasnt.
again, this script is evolving nicely! :slight_smile:

it’s off by default, can you change that it’s on by default?
the button is disabled in all my examples so maybe if it’s on you can avoid even more of those little artifacts left. i’ll have to test it.

if you save your default scene with a mesh under the “file” menu, you can have it pressed on by default on this mesh during a new scene creation, but if you add to this scene a new mesh, it has to be pressed manualy and for every other mesh you add too.

Really good Kai Kostack,really good:)

things evolving nicely. i’ve named the modifier “MicroSubsurf” to not interfere too much with the micropolygon term, but also to give the user an immediate idea what it does by not being too abstract like “AdaptiveSubsurf”, which could have several meanings. just tell me if you think different.

http://img374.imageshack.us/img374/9663/unbenanntye5.png/9663/unbenanntye5.png

i like the name and the reason for naming it differently seems logical to me.
man, you work really hard :slight_smile:
patch? :smiley:

there is still code left to port, so you have to be patient. :wink:

i was playing with an idea in my mind earlier today:
basicaly under microsubsurf there would be one more button, you press it, and it does the following
-adds edge(loop)s into/or subdivides faces that are stretched too far by displacement compared to their neighbours.
image explains it better, about 10 sec .gif.
naming the feature would be the privilege who codes it :slight_smile:
edit: pic removed due to its not relevant anymore

I agree with others… REALLY impressive stuff.

Implementing it as a modifier is a great first (or second) :slight_smile: step… What kind of speed-up have you seen so far from porting it to C?

But micro-poly rendering won’t be as usable unless it created on the fly and thrown away. (that way there is no need to worry about reflections and stuff behind the camera - it would “micro-polygonize” as needed) The memory requirements will simply be too large otherwise. As suggested earlier, each rendering bucket/thread could have its own micro-poly cache.

Something like this seems like it should be coupled very tightly with the low-level rendering engine.

I believe Mental Ray does this, plus some other experimental/research ray tracers. And of course Reyes was the origin of the idea.

not really, there is a hierarchy and i’m not the decision maker over blender development. :wink:

about your suggestion, it’s not necessary i think. because the algorithm subdivides every edge which is to long for the specific settings and distance from the camera. so if you have the micross modifier and a following displacement one then you can just add another micross modifier with exactly the same settings as the first one and only those edges will be subdivided which are to much displaced for the specific micross settings from before. the result will be exactly what you wanted.

edit: after thinking a bit more, i would say this is pretty useless because the displacement wouldn’t become more detailed by this. considering that would it probably make more sense to merge microsubsurf with the displacement modifier than with the regular subsurf one.

edit2: but then again there are other modifiers which can benefit from microsubsurf such as wave. maybe it’s indeed the best to let it be as it is, a separate modifier.

(kai kostack: about your suggestion, it’s not necessary i think. because the algorithm subdivides every edge which is to long for the specific settings and distance from the camera. so if you have the micross modifier and a following displacement one then you can just add another micross modifier with exactly the same settings as the first one and only those edges will be subdivided which are to much displaced for the specific micross settings from before. the result will be exactly what you wanted.)

—wow, my mind just explodes when i try to think this over. isnt that like overkill? i mean, adding another microsubsurf on top of another? like with adding a regular subsurf on top of a subsurf? it subdivides the already subdivided mesh. so a microsubsurfed mesh would be yeah, detailed on the faces i was highlighting, but only with the power of 2 (or 4? im not sure) and much-much more detailed where the camera is pointing so we are back at square one. where according the above mentioned idea this subdivision would only subdivide longer faces than their neighbour ones to keep everything like a grid, homogenous. hmm, think of it, maybe adding a smooth modifier would solve my problem here…:confused:

(kai kostack: after thinking a bit more, i would say this is pretty useless because the displacement wouldn’t become more detailed by this. considering that would it probably make more sense to merge microsubsurf with the displacement modifier than with the regular subsurf one.)

–yeah, i thought you gona mention this :slight_smile:
my reply would be: how about having a random value slider which distorts the surface like you can with the random proportional edit selection. all you need is just a random value…(but the thing i cant figure out in my head is how do you know which faces or verts this has to displace…dunno)

Is it actually a subdivision surface? I thought it was just going to be subdivision.

Kai Kostack- I think LODSubsurf would be more accurate. To me MicroSubsurf doesn’t properly explain what it does. And the abbreviation ‘LOD’ is pretty well known. Even adaptive makes a little more sense. Just my two cents. Excellent work.

gaalgergely, think of the modifier like that: it only subdivides faces and edges which haven’t a specific size. all above will be subdivided until it has the detail you want. let’s say you have a cube and you set the modifier to 1 polygon per pixel, then the modifier will subdivide every face es long as they are equal or below 1 polygon per pixel. now if you apply the same modifier twice to the mesh then only the first modifier can subdivide the mesh because then the level of detail is already what you wanted. therefore the second modifier will do nothing, it recognizes that there is already enough detail. :slight_smile:

and a random distortion doesn’t fit into this in my opinion. if you really need it you should better add just another displacement modifier.

@Surt:
well, for me a surface is just a bunch of faces or even only one face. the subsurf modifier generates faces as well. so it’s a matter of what kind of surface do you mean. it is in fact a simple subdivided surface. no nurbs surface or whatsoever but a surface.

@brian:
LOD, as someone said earlier in this thread, can also mean reducing the detail by distance and that would be the opposit of what it really does. for some people this would turn out to be even more confusing. :spin:

i’m sorry for my ignorance, but what does LOD mean? :smiley:
edit: oh… someone mentioned that here? didn’t notice it…i should read carefully