PDA

View Full Version : question with shaders and lighting.


Xzzy
07-08-2002, 12:55 PM
Having a tough time getting lighting that I can live with using entities and spotlights, so I started exploring the usage of shaders.

Entity lighting is just too blotchy.. it looks ugly, and is a pain in the ass to tweak.

Ie, something like this:

http://tru7h.org/files/shaders/shot0012.jpg

So I made a custom shader, added a light effect to it, and got a nice smooth effect a lot like this:

http://tru7h.org/files/shaders/shot0011.jpg

Now the problem comes in when I set the shader to nodraw. Obviously I want it nodraw so I don't have to look at that grid in my map. However, soon as I do that, jk2 stops applying the light. Annoying, but I guess it makes sense.

I don't like applying light to a structural texture because it makes weird effects on the texure (it lights the texture too, which again is ugly).

So.. is there some workaround to using a light emitting brush that doesn't get drawn, getting the effect I want?

Wes Marrakesh
07-08-2002, 01:02 PM
well, to (possibly) solve the light entity looking bad, you have to place it well with your architecture, like making light emitting objects, like, well, lights
you CAN change the size of the emittied light to make it brighter, which makes it look alot better, trust me:)
save yourself alot of work and figure out entitys;)

Xzzy
07-08-2002, 01:14 PM
not really, if you look at maps that come with the game, entity-based light always looks blotchy.

Load up ctf_bespin and look around in the hallways.. even when they "tie in" the lights to textures you get this lumpy circular blotch of "something" on the floor and ceiling.

I know it's possible.. if you load up one of the old q3a deathmatch maps, the lighting they do there is just amazing.

I just ain't figured out how. :P

RichDiesal
07-08-2002, 01:45 PM
You cannot make a nodraw light emitting texture because the texture calculated light information based on the colors that the light-emitting shader's texture contains.

In other words, if you have an exactly half blue and half yellow texture emitting light, it would theoretically emit light halfway between blue and yellow (which I think would be a blue-green).

Since your shader is nodraw, that means it has no texture information to calculate the lightmap from.

You might be able to add a q3map_lightimage line to your shader pointing at a texture of the color you want light to emit and still keep the texture nodraw. For example, if you want a half blue and half yellow texture to emit green light, you could add the line:

q3map_lightimage textures/somedirectory/greenlighttexture.jpg

...and then make that texture solid green.

Just a suggestion. Not sure if it would work with a nodraw shader or not.

Xzzy
07-08-2002, 09:44 PM
naw it won't work, I'm pretty much resigned to that fact.. I'm just grilling people hoping a solution to get the same effect out of it. ;)

See, look at ctf_bespin. Now I'm not knocking this map, ctf_bespin is one of my favorites.. but it has some seriously ugly lighting. Note the dreaded "blobs of light" fading down the length of this hallway.

http://tru7h.org/files/shaders/bespin.jpg

Ugh. What I don't like about this lighting is not the hotspots so much as the dark areas. The only way to get rid of that patchyness is to drop in even more entities, where the eventual result is to wash everything out so much that you get absolutely no shadows.

Now check out this shot from a well-loved q3 map:

http://tru7h.org/files/shaders/q3dm6.jpg

This baby has it all.. gloomy shadows up towards the top, a spotlight on the wall, subtle differences on the floor.. and not a single blotch to be seen.

Now can anyone offer some input on how id made that kind of lighting? Do they use ambient lighting? Shader lighting?

I experimented with lighting for several hours yesterday and got a decent compromise, but it still ain't perfect.. everything came out way too grey (for reference, that line of runes along the ceiling is emitting light, and I put a ton (like 8 or so per hall) of light=50 entities near the ceiling).

http://tru7h.org/files/shaders/faces.jpg

What I'm trying to do here is pick the brains of more experienced mappers to get some of those elusive lighting tips. ;)