   Outdoor illumination solution
  Hi!I'am thinking of implementing some sort of realtime outdoor lighting system. Let me first describe the type of scenes I deal with:I have only outdoor scenes - terrain, skybox, vegetation, etc. + some objects like small towns (buildings, streets, ...)The primary light is of course the sun (which can very slowly move on the sky), then there are static lights (e.g. on a building) and there are also some fully dynamic, moving lights. The lit objects can also be fully dynamic, but most of them are static.So I need to somehow combine some lightmapping for the sun and static lights with dynamic lighting.My current system is doing realtime lighting of all lights (even static) in shaders, which I'm not satisfied with (both performance and quality). I don't know much about these techniques, so I need some help with it. My first thoughts were about doing ambient occlusion for sun and some sort of radiosity lightmapping for the static lights and static objects. Dynamic lights and objects would be lit and shadowed dynamically in shaders (my target is shader model 3.0).I prefer to use an already existing lightmapper, so that I wouldn't have to program one myself. I am sure there are suitable (free) products.So, please, tell me your opinions and thoughts on this system. Your experiences with these techniques are also welcome.Thanks very much!   
  Hmm, the problem with lightmapping outdoor environments is that you would also need lightmaps for the terrain, vegetation, .. which is not always possible unless you really write your own radiosity renderer, and even then it's not really handy.  We were using ambient occlusion maps as well, but now we don't use 'm anymore because we have dynamic soft shadows from the sun, and then it's somehow a waste of video memory to store all those ambient occlusion maps. But this is perhaps only for our case.So basically I don't really have a solution, but only bad news .. sorry :)Regards,Kenzo   ;  Well, my scenes are almost completely (including terrain, large trees) exported from 3ds max, so there could perhaps be a way to do the radiosity solution there and export it somehow. But as you noted and now that I'm thinking of it again, it's perhaps not worth it. I have a "half-working" system of shadow maps - they look quite good, but of course not as good as the radiosity solution... I guess my only possibility now is to experiment with it a little...Anyway, thanks for the response!   ;Quote:Original post by malyskolacek...Just some suggestions:- ambient occlusion on meshes from themselves, per-vertex or per-pixel depends on viewing distance and LOD.- instanced ambient occlusion for static meshes from static environment - as a another vertex stream.- per-vertex terrain ambient occlusion.- ambient occlusion maps for dynamic meshes from static world (low-order SH?, 4-5 coefficients per NxN meters, entirely on CPU side). As a result, you'll have a sky visibility (ambient term) from 4-5 directions for dynamic meshes.Imagine walking soldiers along a building, and how their 'to-the-building' side get darker...-good shadowing solution. cascaded shadowmaps for example (stable).-sun back-light and/or rim lighting.-height fog.-skybox interpolation.-some fake eye adaptation, depending on the number of visible pixels from the sky. Or even camera angle.. :)-sun blur, based on the number of sun visible pixels.-different post processing filters, depending on day/night cycle.;  Thanks for the response, Zemedelec!The ambient occlusion is something I will definitely experiment with. It seems it would be good performance-wise and it should add some realism to the scene.I'd also like to stay away from SH and similar things for dynamic objects. I think it will suffice to dynamically light them in shaders..., at least for now.A good shadowing solution is what I'm currently tweaking - I have tried TSM with 3x3 PCF and it looks quite good but not all the time. I'll perhaps look into cascaded SM or something like this in the near future.Anyway, thanks again for the info!   ;  check out SH PRT (Precomputed Radiance Transfer) lighting. It is great for distant lights like the sun.It gives you soft shadows, light interflections, SSS (sub surface scattering), and some other fancy stuff in a single pass with great speed.as for the drawbacks ,it works on static geometry (but fully dynamic lights) and it requires much more memory on per-vertex data, it also needs compiling time.if you are using DX, it has build-in compiler for it in D3DX library, and lots of documentation and sample.