Skull, 40000 faces

The little download counter on my super secret world domination dashboard indicates that my thesis code implementations of rendering suggestive contours on 3d meshes has been downloaded over a hundred times. Which tickles my curiosity.

If you’re doing anything fun, serious, silly (or can’t get the damn thing to work at all) with any of my implementations, don’t hesitate to drop me a line. After shedding tears, sweat, blood and probably various other bodily fluids over those implementations during the last year, it would be great to see them ending up in something awesome.

Some images I rendered for my thesis text yesterday. Left: just toon shader. Right: toon shader + suggestive contours + suggestive highlights, an attempt at a Frank Miller-like rendering style. All of this is rendered at min. 24 frames/second at a resolution of 760 x 760.

Today, I managed to perform contour/suggestive contour rendering in imagespace – thus working on a rendered diffuse shaded image. After using the Sobel edge detection filter  to detect regular contours, I looked for an efficient algorithm to detect valleys and creases, in order to draw suggestive contours as well.

As the original paper from D. Decarlo indicates, I needed to exploit the fact that the algorithm should just work for smooth rendered images, whereas most valley detection algorithms are complicated because they provide noise robustness.

While a pixel in a valley is not necessarily the minimum intensity value in a neighborhood, it will be among a thin set of dark pixels that cuts across the neighborhood.If the valley is steep, the neighborhood will also contain significantly brighter pixels away from the valley; We can require a sufficient intensity difference that the surface must be turned meaningfully away.

The good news is that this method also detects regular contours, thus eliminating the need for the seperate sobel filter pass! GLSL code and results behind the cut.
Continue reading »

Using Vertex Buffer Objects to transfer my mesh data (vertices, normals, curvatures) directly into GPU memory using STATIC_DRAW_ARB pointers just tripled the performance of my GLSL shader implementation.

Running a heavy model (+300k vertices) drawn with contours and suggestive contours at 24 fps, average.

The current plan for my thesis is to compare several implementations I made, which all have the same purpose: draw contours and suggestive contours on a given mesh, as fast as possible, as correct as possible. It’s time to review the status of the current builds of these different tools. All of them are written in C++ using OpenGL. Additional libraries are (free)GLUT (for windowing), GLEW (for extension loading) and Trimesh2 (for efficient vertex/mesh operations).

Read more behind the cut.

Continue reading »

For our Capita Selecta project – a freeform 2-semester project with prof. P. Dutré and prof. E.Duval – we decided to build something around Structure From Motion. This involves starting from photographs of an object/environment and ending up with a fully textured 3d mesh – a nontrivial task. Tech babble and more results behind the cut, cool videos here.

Continue reading »

A quick and dirty way to render depthmaps. It requires two passes, so it’s not optimal.

I’ll be using this to pass a depthmap texture to a sobel edge detector (in GLSL) in order to draw contours by generating them in image-space. Other renders (normal-mapped, regular diffuse) will be tested too.

Please note that the proper way to do this is to use a FrameBuffer Object to render to, but since compatibility still is an issue (although they’ve been around since 2004), I’m still using the copyTexSubImage()-way. Mea culpa.

Code behind the cut.
Continue reading »

A new week, a new issue of Thesis Bloopers. In between all the hard, correct work I’m delivering, late night or early morning coding sessions can cause the weirdest bloopers. If you don’t specify the right texture coordinates, it looks like your triceratops is giving birth. Oops.

Since some of my possible future employers might be reading: I fixed it. Quickly.

I’ve implemented the pick-some-random-faces-algorithm (the algorithm formerly known as the Markosian algorithm, from this paper) for suggestive contours too now. Results are a bit better when it comes to framerate, with the big gains of course in models with more faces. For example, of the 40000 faces of the skull, only testing 400 for contours and 400 for suggestive contours gives the following (you can see my nifty FPS counter there too).

Continue reading »

I’ve been implementing an alternative CPU algorithm to draw contours last week. It was pitched by Markosian et. al, and I based my implementation on this Siggraph 2008 class by D. Decarlo.

Instead of testing all faces of a mesh for contours, I only test a configurable amount of random faces. When a contour is found, it is followed as far as possible. The algorithm in its pure form would only deliver good results at large sets of selected faces.

What’s interesting is to keep the seeds (the faces where you found the start of a contour line) of the previous frame. Using this in the next frame render, a high consistency can be achieved, and nearly all contour lines are found in the next frames.

Continue reading »

Code is poetry. Please, Suffusion WordPress theme by Sayontan Sinha