directional radiosity
directional radiosity
I've been reading up on directional radiosity and was wondering if there was any way to generate the directional lightmaps with current tools (i.e. blender or some other FREE tool) before I go slicing into the FSRAD source code
pushpork
By directional radiosity you mean the technique used used in half life 2 for prebaked lights to react to surface normals using 3 radiosity samples on 3 different axes rather than one sample per "surface".
If you are going to modify fsrad, then you need to generate 3x lightmaps (which dont need a mod to the code) but, you will need to modify the surface normals
after the lightmap uv design is done and before the actual radiosity is done. The normal needs to be in a 120 deg pattern like in this pdf,
http://www2.ati.com/developer/gdc/D3DTu ... hading.pdf
That can be generated by modifying the surface normal.
I go against modifying FSRAD, its too slow since it tries to use complex equations for its solver. Also its beam tree goes horribly slow beyond the something like 10000 polygons.
It would be better to write your own radbaker(not as hard as you think if you use simple equations that make sense not the stuff in papers, you can use blenders lightmap uv unpacker as thats probably the hardest part to do), or modify normals using a python script and let blender`s baker do its job three times.
You will need a shader though to render the results of these three bakes.
I think GPU's now are fast enough to fake realtime radiosity, i manged to do small range radisoity on the gpu, i have yet to add shadowing and long range radisoity but that will come after i finish my half year exams, However i really like half life 2's method since it has no limits on the number of participating lights(however its not dynamic).
If you are going to modify fsrad, then you need to generate 3x lightmaps (which dont need a mod to the code) but, you will need to modify the surface normals
after the lightmap uv design is done and before the actual radiosity is done. The normal needs to be in a 120 deg pattern like in this pdf,
http://www2.ati.com/developer/gdc/D3DTu ... hading.pdf
That can be generated by modifying the surface normal.
I go against modifying FSRAD, its too slow since it tries to use complex equations for its solver. Also its beam tree goes horribly slow beyond the something like 10000 polygons.
It would be better to write your own radbaker(not as hard as you think if you use simple equations that make sense not the stuff in papers, you can use blenders lightmap uv unpacker as thats probably the hardest part to do), or modify normals using a python script and let blender`s baker do its job three times.
You will need a shader though to render the results of these three bakes.
I think GPU's now are fast enough to fake realtime radiosity, i manged to do small range radisoity on the gpu, i have yet to add shadowing and long range radisoity but that will come after i finish my half year exams, However i really like half life 2's method since it has no limits on the number of participating lights(however its not dynamic).
"Irrlicht is obese"
If you want modern rendering techniques learn how to make them or go to the engine next door =p
If you want modern rendering techniques learn how to make them or go to the engine next door =p
ooooh, oooooh, ooooooh
i want some of this shiny thing.
anyway, this is very interesting. keep this up.
i may not be up to the task because i still don't know how to perform shading render-to-texture, though i'm working on that.
what i don't know is calculating occlusion for shadowing. radiosity is partly a black art to me at the moment when it comes to coding it from scratch.
but do keep me in the loop.
going back to valve source's method of using three normals (basis), i think they pretty much nailed it right there.
i want some of this shiny thing.
anyway, this is very interesting. keep this up.
i may not be up to the task because i still don't know how to perform shading render-to-texture, though i'm working on that.
what i don't know is calculating occlusion for shadowing. radiosity is partly a black art to me at the moment when it comes to coding it from scratch.
but do keep me in the loop.
going back to valve source's method of using three normals (basis), i think they pretty much nailed it right there.
Basically I was going to implement the surface normal switch thingy into FSRAD. I suppose I could implement my own radiosity processor, which had crossed my mind. The I could easier implement ambient cubes.
A side note: how do you decide the placement of ambient cubes, can it be done with an algorithm or is it better to place them with an editor manually (like the environment maps)
A side note: how do you decide the placement of ambient cubes, can it be done with an algorithm or is it better to place them with an editor manually (like the environment maps)
pushpork
Ambient cubes are cubemaps for moving meshes, with no lightmaps. they can be manually placed or just placed at the center of octreenodes(good for retrieving them) however no auto algorithm will be 100% effective, also these things are 6 images and having one for each node might take too much vram, so maybe use very big nodes from he octree and manually remove nodes that are not needed (outside the level). Also if the camera captures a large area, you must take care of capturing outside the level bounds.
I think you can populate the octree with capture nodes then manually remove the unneeded ones.
Ambient cubes are made using the gpu (six camera dirs for each node) then blurred.
The Camera on the gpu captures the static mesh which has the normal map radiosity applied, or plain old radiosity.
As for the hemi cube, always clamp your dot products for lighting in the 0-1 range unless you want to use the negative value for cheap shadowing.
(when you summate the lights the negatives will darken your mesh so you wont have to fire shadow rays, but then you loose self shadowing of the mesh)
edit: you dont get negative dot products with a hemicube i think because its constructed infront of the face, youd only get them if you you fire random rays like this
where the faces could be behind each other or facing away from each other.
edit: ok i got what you mean, the three normals will have part of their views intersecting the real face, in this case dont let the input be black, just let the input be the ambient term(because nothing is truely 100% black but we dont want it too bright).
I think you can populate the octree with capture nodes then manually remove the unneeded ones.
Ambient cubes are made using the gpu (six camera dirs for each node) then blurred.
The Camera on the gpu captures the static mesh which has the normal map radiosity applied, or plain old radiosity.
As for the hemi cube, always clamp your dot products for lighting in the 0-1 range unless you want to use the negative value for cheap shadowing.
(when you summate the lights the negatives will darken your mesh so you wont have to fire shadow rays, but then you loose self shadowing of the mesh)
edit: you dont get negative dot products with a hemicube i think because its constructed infront of the face, youd only get them if you you fire random rays like this
where the faces could be behind each other or facing away from each other.
edit: ok i got what you mean, the three normals will have part of their views intersecting the real face, in this case dont let the input be black, just let the input be the ambient term(because nothing is truely 100% black but we dont want it too bright).
"Irrlicht is obese"
If you want modern rendering techniques learn how to make them or go to the engine next door =p
If you want modern rendering techniques learn how to make them or go to the engine next door =p
The ambient cube res can be variable,but if its just one pixel per face then you are better off just passing those 6 colours to the shader via some uniform rather than texture data. (im not talking about hemicube here btw).
"Irrlicht is obese"
If you want modern rendering techniques learn how to make them or go to the engine next door =p
If you want modern rendering techniques learn how to make them or go to the engine next door =p