Lighting Problem


(mateo872111) #1

Ok, I’m confused. A few days ago I compiled my map to test out the lighting and it looked like this:

Then I made some changes, I think I changed the intensity of the sun, and it now looks like this:

I have searched through the forums, but couldn’t find anything to help. I’d appreciate any help anyone can offer. Also, I didn’t want to clutter up my post with unneeded details so if you need me to post anything I can.

Thanks in advance.


(nUllSkillZ) #2

You should also post the sun settings.

Try to set the intensity of the sun between the intensity you have used in the 1st and 2nd picture.


(]UBC[ McNite) #3

Do u use _ambient and _color? At which settings?


(Loffy) #4

Hi!
If you want the trees to cast shadows, you can enter the key/value _cs/1. I think. (Not sure, but try it!)

In sum, the keys and values are:
classname / misc_model
_cs / 1

Keep on mapping. That maps looks cool.
// Loffy

EDIT: Just to clarify: 1) deselect everything (hit Escape). 2) Select the model, e.g. a tree (SHIFT + left mousebutton click). 3) Hit “N” on your keyboard, and 4) enter the keys and values (_cs / 1).


(]UBC[ McNite) #5

Btw i can’t see any shadows… not even the buildings cast some. Looks like no sun but a lot of ambient to me.

Personally I think you r better of with posting too many details than posting not enough cuz that way ppl don’t have to ask for more info and can help you right away.


(mateo872111) #6

Ok, thanks for the replies. I’ll post all the details that pertain to lighting so here we go:

Worldspawn:
ambient 3
_color 0.95 0.95 0.95

Skybox Shader:


textures/graveyard/grave_skybox
{
	qer_editorimage textures/graveyard/grave_view.tga
	surfaceparm noimpact
	surfaceparm nolightmap
	q3map_globaltexture
	surfaceparm sky
	q3map_sunExt 0.934 0.956 1.00 30 0 30 2 16
	q3map_skylight 50 3
	skyparms env/graveyard/grave - -
}

Trees:
_cs 1
_rs 1

I think thats everything, oh yea I changed the ambient from 10 to 3 and the intensity of the sun from 0 to 30 and now it looks like this:

and in case anyone wasn’t sure what kind of look I am going for, I want it to look like its just before sunrise. Again thanks for your quick replys.


(]UBC[ McNite) #7

Just before sunrise… you don’t have any sun then, especially none casting shadows. OR u could use a sun that s shining exactly from above. But in any case I d use low to no sunshine and try to find a good _ambient that lightens up the map adequately (solves the prob with pitch-dark shadows/corners too).

Think about the _color: u r using a very light grey (0.95…), but the light before sunset isn’t neutral. It might be a light blue, a light orange… depends on the sky, the clouds and what atmosphere u want.

In any case you ll need to try out a lot of settings to find the best one.


(mateo872111) #8

Thanks for telling me about the ambient color I’ll fix that later, but my real problem is that when I lower the intensity of the sun and skylight only the roof darkens, the walls and terrain stay as light as day. Any ideas as to why they do this?


(mateo872111) #9

I don’t think its this but could it be because the walls don’t have _rs set to 1?


(Ifurita) #10

shouldn’t be. I believe the _rs and _cs keys are only for models


(cementoske) #11

it also depends on your skie, if you take a bright skie like the one from oasis, your map will look much brighter


(mateo872111) #12

Well, I have my ambient, skylight, and sun set at almost no light so shouldn’t that make everything dark?


(TFate) #13

In this case, I don’t think ambience is the way to go. I suggest you get rid of it.

I might be wrong, but I think you might need to adjust your sky’s shader.

Here is an example… this is the shader for skies/sd_batterysky (which illuminates your outdoor map while still supplying shadowing etc.)

textures/skies/sd_batterysky
{
	nocompress
	qer_editorimage textures/skies/topclouds.tga
	q3map_lightrgb 0.8 0.9 1.0
	q3map_sun 1 .96 .87 140 140 8
	q3map_skylight 60 3
	q3map_nofog
	
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm nodlight
	surfaceparm sky
	
	skyparms textures/skies_sd/wurzburg_env/sky 512 -
 
	sunshader textures/skies_sd/batterysunfog
 
	
	{	fog off
		map textures/skies_sd/battery_clouds.tga
		tcMod scale 2.5 2.5
		tcMod scroll 0.0015 -0.003
		rgbGen identityLighting
	}

	{
		fog off
		clampmap textures/skies_sd/battery_mask_ydnar.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		tcMod scale 0.956 0.956
		tcMod transform 1 0 0 1 -1 -1
		// rgbGen identityLighting
		//rgbGen const ( 0.6 0.6 0.6 ) 
		rgbGen const ( 0.4 0.4 0.4 ) 
	}
}

Again, I am not 100% sure of this, I remember something about this in a topic a while ago.


(zl1corvette) #14

I don’t think it’s your sky, your little lamps don’t even seem to be lighting, what’s your light compile look like?


(mateo872111) #15

Yea, I got rid of all the lights other than the sun in my map. I thought maybe one of them was too bright and was lighting up all the walls but as you can see i was wrong. I’ll fiddle with my shader a bit and see if anything helps. Thanks for the suggestions.


(mateo872111) #16

Alright!!! :clap: By using TFate’s advice I was able to tweak my shader to where I get the result that I want. Thanks so much for all the help guys!