About the DOOMIII-style normal-mapping demo: is it something that comes with B3D?

Blitz3D Forums/Blitz3D Programming/About the DOOMIII-style normal-mapping demo: is it something that comes with B3D?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Flynn:
I think he's referring to generating a cubic map every frame for every light source that falls on every character.

Obviously a very expensive way to render lighting for characters.

I wonder if one could get away with precalculating a number of small cubic maps, and just use the one that most closely approximates the direction of a particular light source.

That really depends on how small a cubic map you can get away with. If you can get away with a 16x16 map on each side of the cube, then that'll be somewhere around 6K of texture memory for each cubic map.

If you go with just six directions to start, that's 36K of ram there. But that'll just give you left right front back up down. Not enough light directions. So you can add 4 more directions around the middle, making for 8 compass directions, and then four more around the top and bottom of the sphere, making for 16 additional directons, which comes to a total of 22 directions, making for 132K of texture ram.

But that's still not really enough. So we add eight more around the middle, and eight more around the top and bottom... maye 16 more actually. It's getting complicated. :-)

So 32 + 8 + 22 = 62 which = 327K of ram. Not bad. Light might still be a little choppy chanigng directions though. Might ned to go one higher. Also, 16x16 might not be large enough. So you might have to fo with 32x32 which means you need to multiply the ram requirements by 4.

However, if you can do this and keep the textuee ram requirements under 4 megs, I think you'd be good to go. Then you just have to select the right texture out of like 256 of them that most points in the direction of your scene's light source, and it will work with animated meshes, and not come at the cost of rendering a cube map for every character every frame.