Radiosity with Blender materials question

Hi, I am planning to use the game engine to show products or architecture in realtime. I was wondering if it could be possible to use precalculated radiosity ilumination with blender materials option turned on, due to I love this kind of illumination for realtime presentations and I don’t move any object, only the camera, but I wanted the blender materials too for normal mapping, specular maps … or other tricks. :smiley: (Sorry for the big image, I forget to resize it) (Question 1)

And other recent questions:

-Blender freezes when I use vertex groups in the game engine (P or runtime), anyone? (Question 2)
-Does it’s possible to use static particles (with strand shader) or dynamic particles in the game engine? (Question 3)

‘Question 1’ is definitly possible. Since all radiosity is is baked vertex color, here is what you have to do.

  1. setup everything and bake the entire scene with radiosity (assuming you know how to do that already) one thing you have to look out for is that radiosity creates large amound of faces, you can prevent that with the MaxEI value (1 = do not create new faces)
  2. after done with radiosity, replace mesh and remove doubles
  3. assign textures as usual through the blender material, but MAKE SURE that the first texture channel is set to ADD, (which means it is added on top of the original vertex color) and that VCOLPAINT and VCOLLIGHT is enabled. Like so:
  4. enable use blender material in the game option menu and run the game with ‘P’.

Hopefully that works.

As for question 2 regarding the vertex array, it is likely a buggy driver induced problem, it really doesn’t offer much performance gain even if it works flawlessly, but most of the time it just causes havok. My best advice: leave it off. :smiley:

Q3: No, not possible.

Radiosity will work in the GE even if you leave “use blender materials” off, but I guess you need that on for other things.

Either way, a quality illumination will require at least some subdivision, which feels messy. A good lightmapping tutorial would probably help here, but there doesn’t seem to be one around. Actually I have not seen anyone even talk about baking radiosity to a lightmap. Regardless, I think it would make for a very usefull tutorial.

A lightmap wouldn’t take up all that much texture memory, because you can set it to be quite low-res and never notice the quality drop.

Right now you can look over this guide for finding the balance between radiosity subdivisions and quality, to make for a better performace:

Thanks for the answers!!! :wink: Yes, I already know how to backing radiosity (as you could see on the screenshot) and the fact that It was backed vertex colour, for this reason I though there should be a way to do this. I am testing know all the stuff you post … I will post all the results and screens of the experiments.

Another problem/question is that when I replaced the mesh Blender unifies all object meshes into one. So I was doing uv mapping of the textures in the objects I wanted to texturize before doing the radiosity calculations. I will try doing exactly your steps mpan3 and reporting the results.

First, to do righ the test, I should solve the “replace mesh” problem, due to this problem when all the meshes are unified I can’t apply the materials to the objects I want, and if I did it before apply “replace mesh” only shows the textures applied but other materials properties disappear.

In other related problems (but not important now):
Blender 2.42a for linux freezes when I enter in the radiosity section, so I use a cvs version compiled by me to do the radiosity things, but in this version the VCOLPAINT and VCOLLIGHT couln’t be active simoustanely :confused:, due to this I should use a combination of this two versions for doing this test.

Well, I must sleep (many hours blendering I see vertex, faces, shaders … anywhere :D), I hope we could find the way to use the “replace mesh” option without joint all the meshes.

I hope we could find the way to use the “replace mesh” option without joint all the meshes.

I don’t think you can, of course you can always select parts of the model, boxselect(B), or link-select(L) and then seperate them (P)

Resume of my latest test:
-In an test with a project of many objects I discover that if any object have a different material when it joins all meshes gives a error due to the limit of 16 materials per object, and many meshes stay separated from others. I try to reproduce that on a scene of two objects with 16 materials each without success.
-I already know the method of separete parts of the mesh but I don’t knew the link-select option, It works great! Thanks mpan3 :smiley:

-The bad news, I still couldn’t do Blendermaterials with ambient occlusion backed, I turned on both Vcols, but didn’t work for me (the texture shows in both cases due to is UV mapped), screenshots of two runtimes:

-UPDATE, sorry It seems it works, at least with monkey, I’m still tuning materials, the ambient occlusion in the floor don’t works (I use add as you explain me), and in the monkey looks too dark. I will keep you informed.

Success!!! The floor didn’t display the AO because I added the texture before the radiosity calculation. After the last problems, the wood texture was displayed on the floor and in the monkey despite they used different materials, thanks to the Outliner I found the problem, the mesh unification caused a mess in the materials, with each object sharing all the materials, I broke the links to the wrong materials and ready to gooooooo.

A minor issue was the floor texture with the add option, after a few test I found that Multiply at 74% gives me the result I wanted.

Now I must resolve other minor issues like the lack of specularity (it was working in other tests before), the differences produced by texture/shaded modes, …