directional radiosity

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

directional radiosity

Post by JPulham »

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 :D
pushpork
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

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).
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

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.
Image
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

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) :?
pushpork
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

Also... If The rays for the hemi-cube go behind the poly(DOT(normal, viewDir) > 0), which will happen with non-normal directions should I set them to black and keep them in the equation or set them to zero weight on the final result?
pushpork
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

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 Image
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
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

I thought each face on the ambient cube was 1px (an average of the full render)
pushpork
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

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
Post Reply