[Bf-committers] Radiosity-render

Ton Roosendaal bf-committers@blender.org
Sun, 31 Aug 2003 22:30:03 +0200


Hi,

I'm about to do a pretty large commit, not so much in code but in  
various parts of it. It also includes a change in automake or project  
files. The makefiles I've done myself.

So, for the platform managers to check:
- the link order for Blender has changed, the libradiosity.a has to be  
moved after the librender.a (obviously for a new dependency!). Check  
blender/source/Makefile
- there's a new file: blender/source/radiosity/intern/source/radrender.c

Here's what the new code does:

Using the core routines of the Radiosity tool, each renderface with  
'emit material' and each renderface with 'radio material flag' set will  
be used to itterate to a global illumination solution. Per face with  
high energy (emit) little images are rendered (hemicubes) which makes  
up lookup tables to 'shoot' its energy to other faces.
In the end this energy - color - then is directly added to the pixel  
colors while rendering, Gouraud shaded.
Since it's done with renderfaces, it works for all primitives in  
Blender.

What is doesn't do yet:
- take into account textured color of faces. Currently it uses the  
material RGB color for filtering distributed energy.
- do some smart pre-subdividing. I don't know yet if this is useful...  
Right now it means that you'll have to balance the models yourself, to  
deliver small faces where you want a high accuracy for shadowing.
- unified render (is at my todo list)

This is obviously the advantage; animated radiosity:
http://www.blender.org/bf/0001_0031.avi
http://www.blender.org/bf/0001_0040.avi
The specular is done by adding Lamps with "no diffuse" option set.

http://www.blender.org/bf/monkey.jpg
Note the subtle color bleeding in the head. Its a nice toy!

http://www.blender.org/bf/0001_0100.avi
This is a clear problem with a model moving close through the hemicubes.

Testfiles:
http://www.blender.org/bf/room.blend
http://www.blender.org/bf/Raptor_radio1.blend

User notes:
- per Material you want to have included in radiosity render: set the  
'radio' flag. For newly added Materials it is ON by default now.
- the Ambient slider in Material controls the amount of radiosity color.
- for enabling radiosity rendering, set the F10 "Radio" button.
- the Radiosity buttons now only show the relevant radiosity rendering  
options. Pressing "collect meshes" will show all buttons again.
- for meshes, the faces who use Radio material always call the  
'autosmooth' routine, this to make sure sharp angles (like corners in a  
room) do not have shared vertices. For some smooth models (like the  
raptor example) you might increase the standard smoothing angle from 30  
to 45 degree.

Technical notes:
- I had to expand the renderface and rendervertices for it... shame on  
me! Faces have one pointer extra, render vertices four floats...
- The size of the hemicubes is now based at the boundbox of the entire  
scene (0.002 of it). This should be more reliable... to be done
- I fixed a bug in radiosity render, where sometimes backfaces where lit

In general:
I'd like everyone to play a bit with this system. It's not easy to get  
good results with it. A simple "hit and go" isn't there... maybe some  
good suggestions?

-Ton-

------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton@blender.org  
http://www.blender.org