Sunday, February 8, 2009

Update #1

Hey! What's up? Today I can make my first entry to the blog. I finished a simple occlusion query. And by finished I mean it works but it's not perfect yet. :) It is based on colors, where each color represents a certain node. I render my scene to a texture using their unique solid colors. Then I read the pixels in the RTT and find out, which nodes are visible in the current frame. All the other nodes are set invisible. I don't render to texture on each frame, but after a certain time. Currently the perfomance bottleneck for this method is the reading the pixels. I'm using 256x256 RTT and when updating too often, it tends to slow down. I need to optimize the pixel reading part. Basically what I need is to extract unique colors from the texture and then work with those. My guess is I need to write a shader of somekind? There are other kinks that need to be worked out as well. One being that transparent materials are rendered solid, so when you (player) can see a wall trough the leaves of a tree, the program can't. But the overall perfomance has increased substantially, especially indoors when trees, plants and other nodes that are outside are culled. So the effort was worth it. Anyway, that's it for today. Bye!





























Next on my ToDo list: new chararacter movement model and new vehicle physics

1 comment:

  1. Hi Eigen! How about rendering the scene with lit materials, but turning off all the lights? (and/or setting all the material colors to black) This would cause the tree leaves rendered black, but they'd have texels that you can see through. And for glass materials, you could just not render them, so you could be sure: if you can see through them, the program will do, too. (I'm talking about the extra render loop you do for the occlusion-test!)

    Cheers,
    PI

    ReplyDelete