light does not effect terrain


(eiM) #1

hi again,

I got another problem I can not find a solution for at the moment. In my current mapping project I made the whole terrain by hand and used fueldumps terrain blendings with some alpha brushes. All the terrain parts into a func_group and made them detail.
With my skybox I get some nice shadows and lightning in the whole map, though if I add some light entities of lamps and similar they do not effect my terrain. Means the lights only show up on any other brushes which are not part of the terrain & func group.

Does anyone have an idea why this is the case? The fueldumpshaders are as follows:

textures/fueldump/terrain1_1to2
{
        qer_editorimage textures/snow_sd/mxrock4b_snow.tga
	q3map_baseshader textures/fueldump/terrain_base
	{
		map textures/snow_sd/mxrock4b_snow.tga
		rgbgen identity
	}
	{
		map textures/stone/mxsnow3.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbgen identity
		alphaGen vertex
	}
	{
		lightmap $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbgen identity
	}
	{
		map textures/detail_sd/snowdetail.tga
		blendFunc GL_DST_COLOR GL_SRC_COLOR
		rgbgen identity
		tcMod scale 5 5
		detail
	}
}

(for example)

So is anything in there which blocks the lights manually added by me? I have no idea what I need to change to make it work x)

Best regards,
eiM


(shagileo) #2

Hmm, very strange indeed.
Perhaps try to make the terrain structural, probably it would not give any effect but you can always give it a try.


(eiM) #3

nope that does not help.


(merlin1991) #4

could you give us the keys of the func_group?


(Qualmi) #5

could you tell me why some terrain is func_group. im pretty nooby in such things :confused:


(shagileo) #6

Well normally all of your terrain should be func_group (if you export it from a terrain maker like easygen), unless it is custom terrain and the author hasn’t func_grouped it.

EDIT: the func_group is easier to select multiple brushes.
It is often used in complex or big brushwork such as terrains or gates etc etc…

at least, that’s for what I use it.


(kamikazee) #7

It’s also useful if you want to use Q3Map2 keys on a per-group basis (e.g. _lightscale to make sure a shadow cast onto some specific brush group is really detailed).


(Qualmi) #8

a/sv_pure 0
/g_g


(Qualmi) #9

a ok. didnt know that all exported terrain is func_group. thx.

and yay, i think i know now how i can use this light thing. i make all the terrain func_group, and then i will delete the shader key in all those brushes i want no light on. i think this must work :confused:


(eiM) #10

there are no keys added to my func_group :smiley: should there be the same as in worldspawn such as ambient _color etc? Never used that before in my terrain’s func_group and it always worked :<


(kamikazee) #11

Normally you shouldn’t. I wonder if this thread would have had more helpful advice if it were posted in the Q3Map2 forum and read by Ydnar or obsidian.


(FireFly) #12

My first guess is that there’s something wrong with you lightmaps.

Use /r_lightmap 1 in the console to check if your terrain is lightmapped… It should look like the right image below.


(eiM) #13

Well there seems something to be wrong with the lightmaps :wink: Here is the same part screenshot’ed with r_lightmap 1


(FireFly) #14

Go to your etmain/maps/yourmapname folder, there should be a bunch of lm_0000 lm.tga / lm_0001.tga etc files. Delete them all and recompile your map.

Sometimes when you compile your map a few times there will be some lightmap ‘leftovers’ from previous compiles. The engine might still use these leftovers…


(eiM) #15

nope did not change anything. I can not think of anything else than it has to be reasoned by the shaders/textures used on the terrain… as everything else is effected by the lights.

Ok it really is caused by the textures/shaders I posted above. I just put some random wall texture on the floor and its effected by the lights. As I am a big noob in shader questions could someone please examine the fueldump terrain shaders (fueldump.shader 0to1 etc) and tell me what I need to change? :<

Probably its in the terrain_base shader?

textures/fueldump/terrain_base
{
	q3map_lightmapMergable
	q3map_lightmapaxis z
	q3map_lightmapsize 512 512
	q3map_normalimage textures/sd_bumpmaps/normalmap_terrain.tga
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	q3map_tcMod rotate 37
	q3map_tcMod scale 1 1
	surfaceparm landmine
	surfaceparm snowsteps
}

(FireFly) #16

Well, I’ve made a small “terrain-test-box-map” and applied some of the fueldump shaders and alpha brushes to the terrain and after compile all textures showed up correctly.

So I don’t think that there’s anything wrong with the shaders, they should work, at least they do for me… :

You can download this small test map right here: http://www.wolfedit.com/files/firefly.map

You should probably retexture the alphabrushes with your own shaders for the blending as I used my own alphabrush shaders…
After compile it should look somewhat like the image below:


(eiM) #17

ok great thx for your help up to now. I compiled your map and it looks the way it should.
Now I copy&pasted your small map into mine and compiled with bsp+light to see the effect. There were no ligtheffects on your terrain aswell. This lets me think I did something wrong in the map overall =)

My first idea was about the worldspawn keys, such as ambient , minlight etc… Here is what I have got up to now:

ambient 7
_minvertexlight 12
_color 0.85 0.9 1

Should I add something different which is needed or remove e.g. _minvertexlight?

I think I added it while i was trying to fix the light bug x)

Help appreciated!


(DerSaidin) #18

What compile options are you using? Particularly for the light stage.

Also, can we see a screenshot from in the editor (with no filters, show everything).


(eiM) #19

I am using default ones included in Radiant. There i use:

BSP -meta

and then

-light -fast

For testing purposes only ofcourse. Attatched you see a screenshot of the editor, nothing filtered, though I do not know what you are looking for :stuck_out_tongue:


(DerSaidin) #20

To see what I could see. If there’s any other entities or brushes in there…
How close are those lights to the wall? maybe move them back a little if they’re touching anything.

Try a higher quality light compile.
-light -fast -filter -shade -v -bounce 2 -gamma 1.1 -lightmapsize 256 -samples 4

If the higher quality compile fixes it, then don’t worry about it, since it’ll be fine when you do a final compile before release.

Don’t forget to do some vis compiles now and then so you can see how your vis portals are going.