Modern lighting techniques in B3d?

Blitz3D Forums/Blitz3D Programming/Modern lighting techniques in B3d?

mrtricks(Posted 2004) [#1]
The kind of techniques used in recent AAA games ie Doom 3 et al... okay these use DX9. B3D uses DX7. But I've seen a couple of posts here that suggest these lighting techniques could be used in Blitz, in software mode, a lot slower than would be playable.

I want to make a specific 3D app, and I want to include that kind of lighting (not necessarily specifically Doom 3 but whatever is current) - maybe have a 'preview' mode with no lighting, and then a render mode that outputs an animation with all the lighting bells and whistles.

Can anyone comment about this?


Klaas(Posted 2004) [#2]
check this one
http://www.blitzbasic.com/codearcs/codearcs.php?code=641

i think this is an raytracing like approach


mrtricks(Posted 2004) [#3]
Cool - thanks for that - that might come in really handy, although it would be nice to have something a *little* faster. That was like five seconds per frame; [guess]I imagine I can get something like between 1-5 frames per second with some software-based Doom 3-style lighting.[/guess]


Klaas(Posted 2004) [#4]
per pixel operations in Blitz are slow!
DX9 Shadows are based on pixelshader and operate per pixel

But check out sswift's shadowsystem
this one uses projection and is fast enough to be used in realtime
http://www.blitzbasic.com/logs/userlog.php?user=963&log=269


mrtricks(Posted 2004) [#5]
How slow for per pixel stuff? Like I say, I'm not talking realtime game-type speed here but rendering... If I can get 1 frame per second in what might be a normal game type scene, that's good enough.

I think sswift's system might not be good for me - I want fairly realistic self shadowing etc. For example, a human face lit from the side would be half in darkness, with the nose casting a shadow on the rest of the face.


Dreamora(Posted 2004) [#6]
if you operate on any type of large texture you won't be even next to 1 fps I fear.


AntonyWells(Posted 2004) [#7]
What type of lighting are you after?

You can get lovely, ultra fast multiple per pixel lights using cubic lighting.(They can be colored and all done in a single pass.)

Here's the code I used in cryo for cubic lighting...I'm switching to vivid, so feel free to use it.




the stuff commented out may be of use..been a while since I touched this. but it works as is.(Well it well once integrated;p)

At the light positions, they are not blitz lights, but instead a quad textured with a light. This is rendered onto the player's cubic light map, then projected on. You change the color of these quads to mimic differant light colors. Increase the size of the quad to represent light strength.
fade the light colors to represent fall off.

The actual texture..imagine you were looking directly at a light. a lens flare-ish image.

Use cubemode 2 for normal smooth lighting, cube mode 1 for shiny metalic lighting.

Tangent mapping your other option..but overall, not a realistic one for real-world use in blitz3d.


mrtricks(Posted 2004) [#8]
Thanks for that Spaced -- I'll try that out when I get a chance.