Saturday, January 3, 2009

Baby Back Ribs

I changed the scope of the ribparser project and actually replaced it with a new, more ambitious one, called RibTools.. ..only slightly more ambitious.

The age of parsing is past for now, and it's finally time for some "action". Following the Production Rendering book, I've implemented a basic state machine for a RenderMan scene and started rendering out some very basic primitives: cylinder and cone. I'm forwarding the rendering to OpenGL, using uv values for coloring.
OpenGL is used for convenience and only as a 2D renderer with Z-Buffer, because all the transformations are done following the RenderMan state machine that I've implemented.
The output is currently very crude, but it's nice to see pixels more or less in place.

..I think the image is supposed to read "Pixar", but that's how far it gets with only cylinders and cones 8)
It feels a bit like reverse engineering into the first outputs of a console emulator, only that I haven't really done that much work so far. In fact, there would be a huge work ahead just to get all the geometry to render properly, and then another indefinite amount of work to get some shaders going and then more to actually get performance, and texturing properly with the necessary quality... Basically, to write a proper renderer there would be just too much work for one person in his spare time !

Reading Production Rendering, one thing that bothers me as a real-time graphics developer, is the slow pace at which the REYES approach seems to deal with geometry.
For one thing, much effort is spent towards getting very finely tessellated quadric primitives: spheres, cones, cylinders.. all primitives that in their perfect form are hardly useful for photo-realism.
Perhaps subdivision surfaces, bicubic patches and NURBS are more common. But it all really comes down to what's in input: which CG studios use what and to which extent.

Ultimately, if I find a bicubic patch in input, I really have to deal with it, but if I dive into the REYES system from the start, then I may end up with something that works but that it's not very efficient.
The REYES approach is all about estimating the area that a certain primitive covers and to tessellate appropriately. Tessellation can't be avoided, but doing that every frame seems like a waste of CPU cycles (though it may turn out that it's not so heavy when compared to hiding and shading). A different framework instead would allow for caching tessellation at least for a few frames, while some cached tessellated data is still sufficient.. rather than working out the best fit at every frame.

I guess that for now I'll be happy to get all the geometry for the test image out with a fixed subdivision level, and then I'll see about the next step.
Also the winter holidays are almost over and I'm not sure how much free time I'll have once I get back in the office...  I must say that holidays are addictive !

10 comments:

  1. Cool!!!

    Also, nice seeing you code in your spare time, so that none of us has to remind you!

    ReplyDelete
  2. Can we expect some Rasty software production as well ? iPhone maybe ? 8P

    ReplyDelete
  3. So ... where's the barbecue sauce? 8P

    ReplyDelete
  4. Ragin ..need shaders for that 8)

    ReplyDelete
  5. With the PS3 receiving so little interest from consumers, I wonder what's going to happen to the Cell.
    Do you think the next generation of consoles will get anything similar to the Cell ?
    I haven't developed for it, but I see other developers wishing for something simpler to program.. Also, it's rumored that Microsoft is going to just push more on the GPU side.

    ReplyDelete
  6. i think ps3 sales will go up once more people move to hdtv's

    hard to predict what is going to happen, but Cell promotes the idiom of specialization which always seem to be more efficient than generalization.

    but who knows.....

    here is an interesting way to think about the Cell:

    http://www.insomniacgames.com/tech/articles/0907/files/spu_shaders_introduction.pdf

    ReplyDelete
  7. I'm not sure about the HDTV connection.. you can still have incredible graphics with standard definition and very high quality rendering and anti-aliasing.

    Another lesson that Wii and DS teach is that people that want to play are still comfortable with more abstract graphics.. and perhaps even uncomfortable with more realistic graphics and nothing else. Also because of the tendency to associate realism with ugly brown monsters and rugged space marines that speak in unfunny and overused one-liners.

    Realism in games opens a can of worms of uncanny valleys. It's not just the plastic skin shaders and the zombie-like animation, it's because of the unbalance with every other aspect too.
    Graphics and sound grows but everything else lags behind.

    For example, at the psycho-visual level, a small 16x16 icon may look natural, but the same icon enlarged to full screen looks very unnatural, no matter what stretching filtering one uses..
    I think that this happens at every level and in every domain.. the texture resolution goes up, but the movements are odd and the dialogue is stupid, the balance is broken and people rush back to the sprites because they match with the realism level of every other component.

    Also abstract graphics may just be more stimulating for imagination regardless of the other elements in play. For the same reasons why many people enjoy reading books with no illustrations or why so many music videos insert stroboscopic effects, effectively ruining the possible 30fps.. and TV shows that have recently started adding 60Hz sequences, but only sequences, because maybe running the whole show at 60Hz looks "too smooth" (?)

    ummmummm

    ReplyDelete
  8. Yeah, maybe you have a point from the game playing perspective. But movies definitely look better in HD and Blue Ray seems to be the standard for HD movies now, so that might boost the PS3 sales as the number of peolpe with HDTVs increases...

    ReplyDelete
  9. Blu Ray is the physical standard, but it's already possible to rent HD movies online, so Sony's HD format win may not be that useful after all (especially considering that increases the PS3 cost).
    Interesting for example how Apple completely avoided Blu Ray.. (also because Apple wants people to buy movies using Apple TV)

    Also, Sony can only hope that people that get the PS3 as a Blu Ray player, will actually spend enough money on games (and Sony published movies ?) to make up for the loss when selling hardware.

    mumblemumble

    ReplyDelete