Page 1 of 1

Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 12:10 am
by Kory
Hi everyone! I am new to the forum, and new to editing/building maps for Q3A, however, I worked for nearly 6 years at Insomniac Games, as an environment artist on Resistance 1 & 2, and Ratchet & Clank 3, Deadlocked, and Tools of Destruction.

I am using GTK Radiant, and am having a hard time with lighting... How do you adjust lighting for overall ambience, and how do you adjust lights within the editor.. color, brightness, falloff.. etc

Is there a good thread on using GTK for lighting, or even better, is there a plugin or app that will allow me to light a level once the geometry is finished, maybe with the game running!

I have also been working on some rooms for Return to Castle Wolf, and have found that the lighting is completely whack.. almost black and white, or black and whatever color I pick from the color swatch..

Any help would be great!
Thanks,
-Kory

Re: Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 12:47 am
by fKd
hay, welcome. you have worked on some great games!

ok lighting - for general ambient lighting select a brush (any brush) and press n to bring up the ent viewer/browser thing. you are now working on the world spawn, this can be used for music/gravity etc etc etc (general things that effect the whole map) now type ambient followed by a number, (keep it under 16 to avoid washout.
for color (colour for us british speaking folk) type _color then 3 numbers (rgb) i like to add a light ent then press k and select ya color. open the ent viewer and copy paste the numbers over to ya world spawn.

compile and bam!

hope this helps

Re: Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 12:56 am
by Silicone_Milk
Hi, Kory. Welcome to Quake3World.

You might be interested in taking a look at http://en.wikibooks.org/wiki/Q3Map2/Light to get an idea of how the q3map2 compiler works during the light compiling phase.

An example light compile would look something like "C:\path\to\q3map2.exe" -light -fast -patchshadows -samples 3 -bounce 8 -gamma 2 -compensate 4 -dirty -v "C:\path\to\mapname.map"

I know that's not really related to light editing within radiant but it should help you get better lighting results since you can only do so much with the light entities themselves.

Also it should be noted that there are shader files used in idtech3 that can control how the area around them are lit. Some shaders, when applied to a surface, will emit a light, others will refuse to be lit.

Re: Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 12:57 am
by phantazm11
Hey Kory, welcome to the forums.

Lighting for idtech 3 can be frustrating at first, especially nowadays when newer engines really shine in this area in terms of quality and ease of use. Once you become adjusted to the basics though, this engine can really produce some fantastic results.

I would suggest that you start with the basics and go from there. A good starting place are these lighting tutorials written by Bill Brooks. A lot of elementary principals are introduced by these tutorials, and provide a great foundation upon which to build.

If you have further questions, don't hesitate to ask. We are always willing to help :)

Re: Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 1:27 am
by fKd
gotta love q3w :D

Re: Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 1:34 am
by obsidian
Welcome! What brings you to the world of id Tech 3 mapping?

A little background

The main lighting system id Tech 3 uses is lightmaps. They are bitmaps that are filtered over textures to darken them, providing the illusion of shadows. Without a lightmap, textures are rendered in "fullbright", which is just the absence of a lightmap to darken the base texture. In general, lightmaps are what you need to worry about and control.

id Tech 3 also uses vertex lighting. Vertexes in the map and models are assigned vertex colour values. It's a cheap lighting method and on normal brushes they are usually only seen if you disable lightmaps (for example, if you have a really old system that is having problems rendering lightmaps). On normal brushes, they typically look pretty awful. Models are by default vertex lit only. For models with a relatively high mesh density, this usually looks better than a lightmapped model. You can force lightmapping on models with a few different methods, but it's probably only a good idea to use this on models with large polygons.

Lightmaps and vertex lighting are static. The lightgrid is used to light up dynamic objects (player and weapon models that move around the map). You can think of the lightgrid as a giant 3D grid that spans the dimensions of your map, the contents of which are a bunch of colour values. As the player model moves though out the map, it's vertex colour values are multiplied by the value of the grid that it is passing though. This gives the effect that the player model walks into places of shadow or light.

All three systems are generated by the compiler (Q3Map2) based on the settings of your light sources. You have a bit of control to set them independently from each other on the advanced side of things, but there aren't very many logical reasons to do so.


Light sources

Light sources come from a few different methods: point light entities and shader based lighting. Q3Map2 also introduces global ambient scaling and compile-time light switches.

Point lights are just entities that you drop into the editor via the right-click menu. You can edit it's values by using the entity inspector (n). From the entity inspector, you can control things like intensity, colour, create spotlights, and more advanced Q3Map2 features like penumbras and filtering.

Shader based lights are generated by a shader script (not to be confused with vertex or pixel shaders). In general, shaders control surface and volumetric properties of materials. One of the things they can do is tell the surface to emit light. You'll typically see this used with textures of windows, lights, fire effects and skies. If you're mapping for Wolf, check out some of the shaders that come with the game for examples of typical surface shader lights. The Wolf skies might be a bit dated using the older algorithms, the newer stuff looks better.

Global ambient scaling is a newer Q3Map2 feature, if you select any non-entity brush (any non-entity brush is called a worldspawn) and use the entity inspector, you'll see a few lighting related values like color, _ambient, _minlight, etc. (if not, you might be using an old entity definition file, download a new one here). These are global values for ambient light. Ambient will scale all lighting up, _minlight will set a higher floor value for just the darkest areas. Ambient lighting should be used cautiously, it has a tendency to bleach out shadow details, so if you have to use it, try starting with very low values.

When compiling your map, Q3map2 also offers a few switches to enable other lighting effects like gamma scaling (-gamma and -compensate) and other stuff like ambient occlusion (-dirty) and radiosity (-bounce).


My workflow

My normal workflow for lighting is to start with shader lights. I usually have a sky shader somewhere which provides good outdoor lighting and I do stuff like place light textures and models around the map. This does a good natural amount of lighting so that it looks like the light actually is coming from some kind of source.

I then drop in some point lights in the middle of rooms to provide some fill light. You can target point lights to info_null entities to create spotlights. I usually skip playing with ambient values.

I usually have radiosity and ambient occlusion enabled. I usually also have some low filtering values to make shadow edges look smoother. I may use -gamma and -compensate to tweak the brightness and contrast of light and shadow.



Dammit... this forum is too helpful, in the time it takes to type all this, a bunch of people have already responded. :rolleyes:

Re: Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 12:53 pm
by corsair
For 'dynamic' lighting, check this link;

http://www.splashdamage.com/forums/show ... ght+styles



Obsidian: Allthough lightstyles are mentioned on the q3map2 shader manual site, the link to appendix G is broken, so some key information required for getting them to work is lost there.

Re: Lighting 123... Any good threads on lighting?

Posted: Thu Aug 19, 2010 2:40 pm
by obsidian
I never got around to writing a section to it. If you're looking at the latest version, there's no link, to click on.

Re: Lighting 123... Any good threads on lighting?

Posted: Fri Aug 20, 2010 3:38 am
by Kory
Thanks! This helps a whole lot. I did some lighting at Insomniac, but it was all done through Maya. Pretty much the same thing. I'm going to walk through the tutorial mentioned above later tonight. It seems well written, and easy enough!!

It's nice to find a place like this for help!
-Kory