Radiosity Bumpmapping

Blitz3D Forums/Blitz3D Programming/Radiosity Bumpmapping

JoshK(Posted 2007) [#1]
It might be possible to perform lightmapped bumpmapping in Blitz3D, with specular reflection.

The bumpmap will blend with whatever is underneath it, right? Normally people use vertex colors, but you could insert a light direction map (like a lightmap) in the first texture unit, to control where the light is coming from. This is how HL2 does it.

I assume DX7 calculates the binormal/bitangent arrays on the GPU, then calculates the TBN matrix from those values? If so, this would work.

I have implemented this in my own engine, and have written a bsp/vis/light compiler to compile 3D World Studio files into .bsp files.

If Blitz3D bumpmaps work like I think they do, it should be possible for you to render them in Blitz3D like this:





Colonel_Klink(Posted 2007) [#2]
Hey dude, looks good! your right it, is possible in BlitzBasic. I've been working on a generating a light directional map for the last few days (like a baked on lightmap as you mentioned), I've tested it on a quad, i.e. floor, wall etc. How far have you got? I am finding it difficult to calculate/generate a tangent space matrix. Applying it, and everything else there on out is easy. I am having to "manualy" set up the matrix atm (based on the face tangent space) and apply it to each texel at a time in the light directional map. Looks amazing! But now that I know it works, I need it to automaticly do it for me. I generate my light maps in 3DS Max, it's a shame it can't render a light directional map or alike.


QuickSilva(Posted 2007) [#3]
Any chance of seeing an .exe of this? Pretty please :)

Jason.


bytecode77(Posted 2007) [#4]
that looks good! but where is the radiosity? its just specular bump mapping and lightmaps...


JoshK(Posted 2007) [#5]
That's what Valve calls it, probably because it sounds high-tech:
http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf

I have been using this technique for months, and the lightmapper works perfectly.

However I am storing the light vectors in world space because I found that easier. I don't know how to convert that to tangent space. I guess if I created a matrix, set the X row to the binormal and the Y row to the tangent, and the z row to the normal, then transformed the vector with that, it should work.

I first tried that approach, but I was writing the shader at the same time, so I was double-blind to whether the results were correct or not. So I switched to global space because then I knew the vectors were right.


_33(Posted 2007) [#6]
I've got example code of this sort of bumpmap, but you still have to make the bumpmap layer in order to have this sort of visual, and for most people in the Blitz3D community, I think it's something relatively out of reach. A good tutorial on how to build proper bump map layer would be a good starting point. It's the same problem with specular map. You just don't want to use whatever media on the web, but make your own, and it's not the most evident thing.


Here's an example code from Tom, which require a special DLL that Tom wrote for the occasion. Sadly, I don't have a link to that DLL.



chwaga(Posted 2007) [#7]
where IS tom's DLL!! argh!


t3K|Mac(Posted 2007) [#8]
Look here: http://www.blitzbasic.com/Community/posts.php?topic=73478


bytecode77(Posted 2007) [#9]
but thats environmental bump mapping AND NOT dot3 bump mapping which josh showed there.

if you want ENBM, just download the devil shadow system...