PDA

View Full Version : Stroke based rendering



SeskaPeel
04-13-2004, 06:45 AM
Here is my first draft on real time stroke based rendering : NPR Gallery (http://www.succubus.fr/NPR/)
I have some problems with implementation, as the whole stuff is done in software.

First pass render the scene in 160*120, glReadPixel it and then process this buffer (gradient and box filter). Tangent to the gradient gives the orientation of the stroke. But ... it seems like I process the buffer before the glReadPixel has finished its work. So I tried glFinish() and glFlush() all around, but it had no impact. The weird behaviour is that you see the gradient buffer refining itself over time.

Secondly, I'd like to hardware accelerate this stuff. Any suggestions ? The first problem will come with the box filter that needs multiple iterations until all 0-length vectors are overwritten.

Credits goes to Karl-Anders Johansson from the yodel team. This is a pale copy of their demo "32 degrees in the shade".

Suggestions and critics and flames welcome.

SeskaPeel.

mogumbo
04-13-2004, 07:23 AM
Arg! You keep taunting us with your screenshots. I want to *play* this game! How about an alpha version or something??

SeskaPeel
04-13-2004, 07:36 AM
Waiting for a publisher ... can't release a demo before. Prey for us he won't wait too long.
What about the shots ?

jwatte
04-13-2004, 09:43 AM
glReadPixels() is synchronous, it will return finished pixels up to that point in the pipeline. Your bug must be something else.

One way of doing brush strokes is to have the artist provide an indication of how to put the strokes, on the models. One way of doing that is to have a texture with horizontal stripes, and have him map each model a second time using this texture; place the strokes in the direction of the U texture vector.

PS: you probably want us to "pray" for the publisher, not "pray" on him :-)