The presentation i’ll be giving tomorrow

After squashing a rather nasty bug this morning (GLSL shader memory alloc is tricky), I made some renders to demonstrate the algorithm.

The algorithm is an object-space algorithm.  This has some implications: Operations are performed with direct vertex info. No intermediate rendering+signal filtering is done. Rendering it on the GPU makes it hard to control line width. This is the main disadvantage in using this algorithm over a CPU-implemented one. The main advantage is – of course – significant speedup in rendering.

The current version computes info for all vertices. I think I can speed things up a bit more by adding some additional tests in the vertex shader, which could signal the fragment shader that the fragment is unlikely to have contours. Whether or not the additional overhead of these tests is worth it, we’ll see. Pretty images behind the cut.

I don’t know what just happened to my shader, but this sure looks funky.

I’ve been trying to work out a good CPU-accelerated version the my suggestive contours algorithm during the last few weeks, and after working through some technical difficulties, I managed to compute and draw regular contour lines this afternoon:

Hard to see? I know,  it looks craptastic.

But after an afternoon of reading tutorials, bulletin boards and newsgroups, I know why. And I think it’s going to help me write a better thesis, so this delightful saturday wasn’t completely wasted. Conclusions behind the cut.

An overview of the work done upto january on my thesis. My most recent work (on the GLSL implementation) is not included, this is all rendered using the CPU. The main differences with last video:

  • Better viewport consistency by applying fading of the contour lines. (Reduces flicker effect)
  • Optimalisation of suggestive contour rendering using an additional paper: Interactive Rendering of SC with Temporal Coherence (also from Decarlo et. al.)
  • Quick and dirty implementation of suggestive highlights

Today I rewrote parts of Trimesh2’s Mesh Viewer to work with GLSL-shaders. I implemented a simple cartoon shader. This is still pretty basic, since it doesn’t involve sending information back and forth between OpenGL and the shader.

Still, here is the result.

Because my current Suggestive Contours/Suggestive Highlights implementation is written using OpenGL calls for rendering, it was best to start work on the vertex/fragment shaders for a GPU implementation in the OpenGL shading language (GLSL). This would reduce OS/Platform dependency too. Another option was using Nvidia’s Cg, which claims to be compatible with an OpenGL renderer too, but documentation about this was scarce

In the second semester of this year, I’ll have to apply the suggestive contours algorithm I’ve implemented in an interesting way, in order to have some experimental results upon which I can base my thesis. A report on what I found out behind the cut.

Some more features implemented in my thesis project:

  • Stroke fading (soft lines + anti-aliasing)
  • Suggestive Highlights (still some tweaking – in combination with suggestive contours they give a false “embossed” impression)
  • Various optimizations for time-coherent contours (see this follow-up paper). The ‘flickering’ issues I had with changing viewports have been reduced severely.
  • Quick and dirty GUI for testing.

Unfortunately, no video yet, since recordmydesktop (even with the –full-shots switch), has issues recording OpenGL output in Ubuntu running in a Virtual Machine.

Suggestive Highlights

Suggestive contours hemoglobinHaving finished the basic implementation of contours and suggestive contours, I’m now implementing features like fading and suggestive highlights. I thought it would also be interesting to test my current implementation (and the effect of suggestive contours themselves) on some interesting test objects.  Findings behind the cut.

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