Jx423@Posted: Fri Jan 11, 2013 2:40 am :
I need some help evenly lighting a white room.

When I use a point-light, I get hotspots on the wall. I tried to mitigate this problem by lowering the brightness, but this caused the room to look like a grey-scale gradient, which is not the look I want.

I think the solution might be parallel lights, but I am not sure how to use these. Every attempt just ends in confusion or frustration, even after reading the Katsbit's page on parallel lights.

How can I use the lighting to get an evenly lit room? (I am using a white texture for the room.)



motorsep@Posted: Fri Jan 11, 2013 3:28 am :
Add an extra stage to your white material:
Code:
{
blend add
map textures/my_white_room_texture.tga
rgb 5.0 // varying that value you can make your texture appear fullbright
}



Jx423@Posted: Fri Jan 11, 2013 5:16 am :
motorsep wrote:
Add an extra stage to your white material:
Code:
{
blend add
map textures/my_white_room_texture.tga
rgb 5.0 // varying that value you can make your texture appear fullbright
}



I take it I am supposed to add this to the .mtr file. Is there a way to know whether or not it worked?

Also, once I successfully change the code, what would be the best way to light the room?

Thanks for the help.



motorsep@Posted: Fri Jan 11, 2013 5:34 am :
Yeah, that's for material.

Let's say you have materials/white_color.mtr decl which contains following material declaration:

Code:
textures/white_rooms/white_color
{
   {
      blend diffusemap
      map textures/white_rooms/white.tga
   }
}


when you add second stage, it'll look like this:

Code:
textures/white_rooms/white_color
{
   {
      blend diffusemap
      map textures/white_rooms/white.tga
   }
   {
      blend add
      map textures/white_rooms/white.tga
      rgb 5.0
   }
}


It's not code per se, it's how materials are defined for idTech 3 an idTech 4 engines.

You still need light to have shadows cast by the models/brushes and you probably want to make that light with "nodiffuse" "1" and "nospecular" "1" so it won't interfere with your fullbright room. So the light source will only allow for shadows to be cast. If you are going to have models in that room (and if your whole game will be made with such levels) you might want to have every material with such second stage. Or you can add ambient lights into your levels to make have lighting on models to go along with the overall style of the levels.



smurkenstein@Posted: Fri Jan 11, 2013 9:13 am :
Its been a very long time since I edited in doom, but can't you just float a few lights in the room, above head height, not too bright, obviously don't use a model as you'll see it floating there. Tweak the position/luminosity/colour switches to make it nice and even.



motorsep@Posted: Fri Jan 11, 2013 9:17 am :
It all depends on his art style. The less lights, especially moving ones, the better for performance.



bkt@Posted: Fri Jan 11, 2013 10:17 am :
Kat's bits tut using parallel lights.



Tron@Posted: Fri Jan 11, 2013 1:43 pm :
If you're feeling really energetic, follow the technique that Lunaran used for his Q4 map Strombine:

http://lunaran.com/page.php?id=165



aphexjh@Posted: Fri Jan 11, 2013 4:20 pm :
I have found 2 methods useful, if I am going to divorce myself from ambient lights (which i think can still be acceptable if used subtly, especially as seen in strombine).

The first method involves 2 lights:
- 1 point light which casts shadows (this can also be a directional light if desired, and should originate from the light source)

- 1 directional light which does not cast shadows (this should originate or mimic the direction of the major reflecting surface of your choice, for instance the floor)

Image

The second method is essentially identical to the first, although i think it offers more versatility in lighting because i tend to think that point lights look better than directional ones. It basically entails changing the second light to a point light and moving the origin to a position which represents the major reflecting light source. To be clear it requires:

- 1 point light which casts shadows (this can also be a directional light if desired, and should originate from the light source)

- 1 point light which does not cast shadows (this should originate or mimic the direction of the major reflecting surface of your choice, for instance the floor)

Image

In either case the second light, which simulates reflected light, should be at most half the brightness of the main light source. Which means you should change the second and non-shadow casting light to a dark grey (or another dark color, for instance a dark brown might be appropriate in a cave with dirt floors).



Jx423@Posted: Fri Jan 11, 2013 8:14 pm :
motorsep wrote:
Yeah, that's for material.

Let's say you have materials/white_color.mtr decl which contains following material declaration:

Code:
textures/white_rooms/white_color
{
   {
      blend diffusemap
      map textures/white_rooms/white.tga
   }
}


when you add second stage, it'll look like this:

Code:
textures/white_rooms/white_color
{
   {
      blend diffusemap
      map textures/white_rooms/white.tga
   }
   {
      blend add
      map textures/white_rooms/white.tga
      rgb 5.0
   }
}


It's not code per se, it's how materials are defined for idTech 3 an idTech 4 engines.

You still need light to have shadows cast by the models/brushes and you probably want to make that light with "nodiffuse" "1" and "nospecular" "1" so it won't interfere with your fullbright room. So the light source will only allow for shadows to be cast. If you are going to have models in that room (and if your whole game will be made with such levels) you might want to have every material with such second stage. Or you can add ambient lights into your levels to make have lighting on models to go along with the overall style of the levels.


Right now, I have a .mtr file with all of my custom textures. The part with my white texture information reads:

Code:
textures/custom/white
{
   diffusemap   textures/custom/white_d.tga
   

}


Your code seems to have a segment which refers to a specific map. My map is named "white". I am not sure if I am supposed to include another step that refers to this map of what.

So with my code, how exactly would everything read after following your instructions?



motorsep@Posted: Fri Jan 11, 2013 8:17 pm :
Jx423 wrote:
Right now, I have a .mtr file with all of my custom textures. The part with my white texture information reads:

Code:
textures/custom/white
{
   diffusemap   textures/custom/white_d.tga
   

}


Your code seems to have a segment which refers to a specific map. My map is named "white". I am not sure if I am supposed to include another step that refers to this map of what.


diffusemap textures/custom/white_d.tga is a shortcut for:

blend diffusemap
map textures/custom/white_d.tga

This way if you don't need to do any "magic" with your diffuse stage, you can save yourself time by using shortcut.

Jx423 wrote:
So with my code, how exactly would everything read after following your instructions?


Code:
textures/custom/white
{
       diffusemap   textures/custom/white_d.tga
       {
             blend add
             map textures/custom/white_d.tga
             rgb 5.0
       }
}



Jx423@Posted: Fri Jan 11, 2013 8:56 pm :
Perfect.

I keep seeing 'ambient' lights mentioned. Can you explain to me what these are?



motorsep@Posted: Fri Jan 11, 2013 9:04 pm :
Pretty informative:
viewtopic.php?f=39&t=21230&start=0&st=0&sk=t&sd=a&hilit=ambient+light
http://www.trisoup.net/temp/d3ambient/



rebb@Posted: Sat Jan 12, 2013 12:50 am :
Since there's not that much info on what ambient lights actually are in those links and modwiki seems to be down :

Ambient lights are a special type of light in Doom3 specifically made for "evenly lighting" an area.
They behave sort of like standard lights without shadowcasting, except they have no actual origin from where the light emanates - their look depends a lot on the lightImage / lightFalloffImage and how they are implemented in the lighting shader of the game.

Unfortunately they are pretty ugly in stock Doom3, so if you want to use them you will probably need a shader mod or an adjusted binary based on the source releases, to improve their look.



Jx423@Posted: Tue Jan 15, 2013 8:39 pm :
rebb wrote:
Since there's not that much info on what ambient lights actually are in those links and modwiki seems to be down :

Ambient lights are a special type of light in Doom3 specifically made for "evenly lighting" an area.
They behave sort of like standard lights without shadowcasting, except they have no actual origin from where the light emanates - their look depends a lot on the lightImage / lightFalloffImage and how they are implemented in the lighting shader of the game.

Unfortunately they are pretty ugly in stock Doom3, so if you want to use them you will probably need a shader mod or an adjusted binary based on the source releases, to improve their look.


Where are they located in the editor?



chimueloeldragon2011@Posted: Tue Jan 15, 2013 9:22 pm :
Just create a light and then open the light editor (J)
From the list select lights/ambientlight, they're at the top below the fog lights



nbohr1more@Posted: Wed Jan 16, 2013 4:32 am :
One thing that hasn't been mentioned is that truly flat lighting requires a that there be no falloff for either XY or Z. There are lights materials with "nofalloff" that are specifically for that type of lighting whether ambient or standard. Or you can make your own using the "_white" dynamic internal image for both the projection image and falloff image.



motorsep@Posted: Wed Jan 16, 2013 4:49 am :
You don't really need lights for flat lighting. Why waste resources and you can cheat and have same visuals :)



Jx423@Posted: Mon Jan 21, 2013 10:00 pm :
chimueloeldragon2011 wrote:
Just create a light and then open the light editor (J)
From the list select lights/ambientlight, they're at the top below the fog lights


Thanks