Specifying minimum light levels in a shader


(DickDastardly) #1

Hi all,
I’ve got a partially transparent plant texture but the opaque parts are a bit too dark in certain areas of my map. Is it possible to specify within the plant’s shader a minimum light level so that my plant will never be darker than a certain level, regardless of the light falling on it?

Alternatively, would it be possible to specify a multiplier which would increase the brightness of the texture by, say, a factor of 1.5?

I want the effect to only apply to instances of this one texture and not the whole map. Thanks in advance for your help,
DD


(shadowspawn) #2

maybe also use entity lighting and add a lightjunior near there…


(DickDastardly) #3

I’m using entity lights, but I’ve not heard of lightjuniors before, and searching here and in the q3map2 manual didn’t turn up anything. Could you elaborate?
Cheers,
DD


(shadowspawn) #4

the entity.def that comes with gtk is about a year old, but since you’ve worked with shaders before here’s the deal… find where the entity.def is. usually baseq3/scripts or if you are mapping for a mod whatever fs_game scripts

k first thing about the entity.def is its nothing but an ascii file, and anything between the /* and */ is an entity that radiant uses. its sorta backwards, what you would think would be a comment isn’t.

open up the entity.def file and look for the QUAKED light

add this definition after it.


/*QUAKED lightJunior (0.8 0.9 0.8) (-8 -8 -8) (8 8 8) nonlinear angle negative_spot negative_point
Non-displayed light that only affects dynamic game models, but does not contribute to lightmaps
"light" overrides the default 300 intensity.
Nonlinear checkbox gives inverse square falloff instead of linear 
Lights pointed at a target will be spotlights.
"radius" overrides the default 64 unit radius of a spotlight at the target point.
*/

its basically a light that doesn’t affect the brush surfaces for lightmaps, acts the same as a light with scale options during light compile, targets, and colors. it only affects the lightgrid itself, it was introduced in wolf and ydnar left it in for q3map2.

Textures that have shaders with a rgbGen lightingDiffuse pass on it will be affected. It may or may not be what you wish for, just look at your weapon cg_drawgun 1 and see how well its lit. it might wash it out or require some texture brightness/contrast tweakage.

http://www.shadowspawn.net/temp/light_junior3.jpg is an example, notice how awash the entities are in blue, but the brushes aren’t.

-edit-

you know a really simple solution would be to take a really close-to-blackscale-but-nt-quite-pitch-black image in photoshop, save it as a 32x32 tga ad just do a blendfunc add pass; that would literally raise the whole image up a bit in the shader and you can mess around with it without recompiling.


(DickDastardly) #5

Ah, the latter sounds good, I’ll give that a go.
Cheers m8,
DD