diff options
author | Ton Roosendaal <ton@blender.org> | 2003-09-01 00:33:46 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-09-01 00:33:46 +0400 |
commit | 470b5c0366dd31197b7ba39b5c2bc2256a3d8d0f (patch) | |
tree | f08dc5e73c5447a966dcc1b9a6e3203a1dcb60a2 /source/blender/blenkernel/intern/material.c | |
parent | b64b5d7b63ff852f3fe210fd8200912538f46bd4 (diff) |
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)
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?
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index a74670dbde9..5d0c1fcc739 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -102,7 +102,7 @@ void init_material(Material *ma) ma->param[3]= 0.1; - ma->mode= MA_TRACEBLE+MA_SHADOW; + ma->mode= MA_TRACEBLE+MA_SHADOW+MA_RADIO; } Material *add_material(char *name) @@ -566,6 +566,8 @@ void init_render_material(Material *ma) } if(ma->mode & MA_VERTEXCOLP) ma->mode |= MA_VERTEXCOL; + if(ma->mode & MA_RADIO) needuv= 1; + if(ma->mode & (MA_VERTEXCOL|MA_FACETEXTURE)) { needuv= 1; if(R.osa) ma->texco |= TEXCO_OSA; /* for texfaces */ |