I must say I’ve come a long way over the course of one school year. When I started fall quarter I hadn’t the slightest clue how to work with OpenGL let alone set up a window that was running the API. I pushed myself hard. I made a working game with minimal knowledge, I’ve made an animation system, and I’ve even begun to understand the concepts around the OpenGL shading language. I don’t like to look at this project as a failure, but as a reflection on how much I’ve pushed myself.
I started working on this project as soon as I proposed it. When I decided on non-photorealistic rendering I knew I needed to get reading as soon as possible. I started research and reading the orange book. Before I knew it, the syntax and setup of the vertex and fragment shaders of OpenGLSL seemed very familiar to me. I made a lot of progress in little time.
It soon became apparent that writing the shaders was the easiest part of the process. Setting up the application around the system was by far one of the most frustrating problems I’ve dealt with. As I’m going to make clear in my presentation, one of the first problems I ran into was the loading of bitmaps. My previous experience with C++ has been great dealing with only text files and algorithms. However, working at a system level was somewhere I had yet to traverse. I searched for sample code and tried to covert it to work with OSX. Every time I booted something up, it either crashed or didn’t even compile.
I had to admit defeat with C++ and just find a working template to build upon. Time was running out. I started looking up the NeHe (Neon Helium) tutorials for a place to start. Their OSX conversions were built in Cocoa. I had tried to learn it during my animation algorithms class before, but I was unsuccessful after two weeks of studying it intensely. To get started this time, I did what I was most capable of doing. My first task was commenting the code I found. With the understanding I would piece together different blocks when I made progress. If I was to add anything, I would try to keep it in C code without breaking the program. What I got as a result was bitmap loading in one program, and shader loading in another. I had a working environment to do my proposed assignment, but by then, it was the day before it was due.
I had to make a choice. It seemed most proper to start building my presentation in case I worked through the night. With that done I stumbled across the gold mine. I had found the ARB code for the paper I wished to replicate. It was poorly commented and in a shading language I didn’t understand. Yet, I fought against the odds and tried deciphering it. Unfortunately, I fell short of the finish line.
What I did get done I consider easy. A toon shader is just… so simple when you grasp the concept. On one end, I’m ashamed that I had to settle with my backup. On the other hand I’m happy that I at least got that far. I’m pretty sure I hit upon every error possible while working on this project. I didn’t even have the latest version of the OpenGL framework!
All I can do now is look toward the summer. I’m going to spend more time working with OpenGLSL to replicate and expand the real-time hatching system. With just a little more development, it could give such a visceral effect running at real time speeds. Cheers to learning more.
Tuesday, May 20, 2008
Monday, March 31, 2008
Non-photorealistic Rendering: Breathing life to a drawing
I am personally tired of photorealistic graphics. The amount of work involved is obscene and with games like Crysis already on the market it is rather depressing how far one has to go to catch up to today’s standards. Just recently I found the title for an area of interest: Non-photorealistic redering (NPR for short). I’ve seen fascinating examples in video games such as The Legend of Zelda: Wind Waker, Okami, and Sly Cooper. Most seem to focus on some sort of cartoon shader. I however wish to do the following:
• Display a teacup and a sphere next to each other
• Render the teacup and sphere in a sketch form (I will settle for a cartoon shader if this becomes a problem)
• Add noise parameters to the rendering of specific objects to create movement along the different pieces of the model
• Run in real time
I am currently using a 1.67 GHz Powerbook G4 laptop with 2 GB DDR SDRAM. I will develop the system in a GLUT window in C++ using Xcode as my primary text editor. I plan to use objects rendered in OpenGL that will be shaded using my own code in the OpenGL shading language. I will then attempt to adapt my shader using Ken Perlin’s noise function.
My itinerary will look like this:
• Weeks 3-5: Research on NPR techniques
• Weeks 6-7: Learn the OpenGL shading language
• Weeks 8-10: Implementation
My final presentation will likely consist of slides describing the techniques used in my implementation ending with an in-class demo of my results.
• Display a teacup and a sphere next to each other
• Render the teacup and sphere in a sketch form (I will settle for a cartoon shader if this becomes a problem)
• Add noise parameters to the rendering of specific objects to create movement along the different pieces of the model
• Run in real time
I am currently using a 1.67 GHz Powerbook G4 laptop with 2 GB DDR SDRAM. I will develop the system in a GLUT window in C++ using Xcode as my primary text editor. I plan to use objects rendered in OpenGL that will be shaded using my own code in the OpenGL shading language. I will then attempt to adapt my shader using Ken Perlin’s noise function.
My itinerary will look like this:
• Weeks 3-5: Research on NPR techniques
• Weeks 6-7: Learn the OpenGL shading language
• Weeks 8-10: Implementation
My final presentation will likely consist of slides describing the techniques used in my implementation ending with an in-class demo of my results.
Subscribe to:
Comments (Atom)