Note a small change in the shader code below... from "rgb global0 to red global0, green global1," etc.
I've implemented BloodRayne's ambient lighting technique for our map in order to remove the completely dark areas. For example, in the test vid when I was inspecting Mord's (awesome) building, I had to switch on the flashlight even though the sun was out and elsewhere it was very bright. Of course, the reason there was no light between Mord's buildings was due to the fact that the light that I was using as the "ambient light" was positioned in the center of the map, so any areas behind other buildings were not being lit. Now, in real life, surfaces reflect some amount of light, and that's why even a light with a small "volume" can light up an entire room. Since Doom3 can't do this (yet...) we'll just have to work around it. After looking at a number of different ambient lighting techniques and testing some of them out, I think BloodRayne's looks the best and is the most flexible for our needs.
Implementing BloodRayne's lighting technique has bonuses...
- No extra ambient lighting indoors that "bleeds in" from the outside.
- There's one less light that hits everything in the entire map. That means that the lightcount in the map is incredibly low... actually, it's one, plus whatever we put indoors or set up as street lights and such. The change also results in a small performance increase.
- Plus, I've altered BloodRayne's technique to use global shaderParms, so the ambient parameters can fade smoothly using scripts. And, if we wanted, we could sepreate "exterior" and "interior" textures and give them unique global parms so that we could have varying degrees of the ambient effect indoors and outdoors.
When I'm done, there will be no pitch-black areas in the map, only one light will be used for both the sun and moon, and mappers will have more artistic freedom when lighting their blocks.
I'm nearly finished with adding the code to all of the current textures (except for "interior" textures if they were specified as such). If you make any new textures, please add this code to them:
Code:
{
blend add
map textures/euro/path-to-diffuse-texture.tga
red global0
green global1
blue global2
}
So... the brick_red_lrg material would go from this:
Code:
textures/euro/shared/idiom/brick_red_lrg
{
qer_editorimage textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
diffusemap textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
bumpmap textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_local.tga
}
To this:
Code:
textures/euro/shared/idiom/brick_red_lrg
{
qer_editorimage textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
diffusemap textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
bumpmap textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_local.tga
{
blend add
map textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
red global0
green global1
blue global2
}
}
Of course, I've saved all of the old material files, so if folks decide that we don't want to use this technique, we can revert with little effort.
Let me know what you think.
Goliath