How can i get rid of those reared shadows?


(lennyballa) #1


See those ugly black lightning? How can i “destroy” it. I can place 10 lights for it and it still is such black shadow. I also tried terrain lightmaps or something but somehow i can’t get it to work. Anyone got a solution on this?


(OSIAS) #2

so what kind of compile are u doing?

i would do a full compile with the bounce -8 …

also m,aybe throw a litle ambient light witha hint of maybe yellow in it…

would make those shadows either go away or look alot better…

but i bet its the sky texture ur using thats casting that shadow…

might try changin that too…

well good luck! :cool:


(OSIAS) #3

i dont think the sky texture is doing this… forget that part…


(lennyballa) #4

hmm someone know how to make those terrain lightmaps? I don’t understand the tuturial i saw, about base shaders and stuff it’s all sooo confusing…


(hummer) #5

It’s not that bad really…

This is really all you need:

http://shaderlab.com/q3map2/lmt.txt

Assuming you made your terrain in easygen, it’s a fairly straight forward conversion. Make a “base” shader like such:


textures/terrain/hillside_base
{
	// required
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )	// project texture every 256 units in X and Y
	q3map_lightmapaxis z						// project lightmap on z axis (up/down)
	
	// optional
	q3map_lightmapmergable						// merges all terrain into one seamless lightmap (no seams)
	q3map_lightmapsamplesize 32					// sets lightmap sample size to 2x normal to save mem			
}

Then for each layer you make something like this:


textures/terrain/hillside_0
{
	q3map_baseshader textures/terrain/hillside_base	// instructs q3map2 to use this shader as a template
	
	{
		map textures/terrain/hillside_0.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

…and for each of the blended layers:


textures/terrain/hillside_0to1
{
	q3map_baseshader textures/terrain/hillside_base
	
	{
		map textures/terrain/hillside_0.tga
	}
	{
		map textures/terrain/hillside_1.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

The idea is that the layers and blended layers inherit properties from the base shader. Also, check out the terrain shaders that come with ET for a better idea and more commands to add to the shaders… I’m at work at the moment and can’t check, but there’s a way to increase the resolution of the light maps to make them look a lot nicer.

Anyway, what you’ll do is make a base shader like above, then convert all your other shaders to look like the two lower examples.


(lennyballa) #6

Thats the part i dont understand? How do i need to call the base shader?
Is

textures/terrain/hillside_base
{
// required
q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) // project texture every 256 units in X and Y
q3map_lightmapaxis z // project lightmap on z axis (up/down)

// optional
q3map_lightmapmergable // merges all terrain into one seamless lightmap (no seams)
q3map_lightmapsamplesize 32 // sets lightmap sample size to 2x normal to save mem
}

the only thing thats needed in your shader, or include the rest also un this shader? Do i need to include this in my usual shader? My shader is called lennybals, and only has terrain textures. But, if i do this were do i need to put the surfaceparm landmine? I made it from easgen. Could you please make a clear tuturial? I just don’t understand the stuff with shaders :frowning:
butt thanks anyway hummer


(hummer) #7

So, is it you’re not sure what to do with terrain shaders, or shaders in general? It helps to already know a bit about shaders before you start messing with terrain shaders :slight_smile:

I’d tell you exactly what to do, but it’d be time consuming on my part depending on your exerience, and it’s usually better to learn on your own :slight_smile:

My suggestion is to play with shaders, learn about them, and read the shader bible / manual… it’ll help a ton.


(lennyballa) #8

i know a bit how shaders work, what they do and stuff. But not what to do with the upper stuff :frowning:


(lennyballa) #9

I use 2 shaders now. 1 called baseterrain with this inside:

textures/baseterrain/baseterrain
{

	q3map_lightmapsampleoffset 8.0
	q3map_lightmapaxis z
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
}

the second one is called lennybals with this inside:

textures/test/terrain_0
{
 q3map_baseshader textures/baseterrain/baseterrain  
{
	surfaceparm nolightmap
	q3map_novertexshadows
	q3map_forcesunlight
        surfaceparm landmine
        surfaceparm trans 
        surfaceparm alphashadow 
	{
		map textures/desert_sd/sand_disturb_desert.tga
		rgbGen vertex
		tcmod scale 0.090 0.090
	}
}

textures/test/terrain_1
{
 q3map_baseshader textures/baseterrain/baseterrain  
{
	surfaceparm nolightmap
	q3map_novertexshadows
	q3map_forcesunlight
        surfaceparm landmine
        surfaceparm trans 
        surfaceparm alphashadow 
	{
		map textures/desert_sd/sand_patchy.tga
		rgbGen vertex
		tcmod scale 0.090 0.090
	}
}

textures/test/terrain_0to1
{
 q3map_baseshader textures/baseterrain/baseterrain  
{
        surfaceparm nolightmap
        q3map_novertexshadows
        q3map_forcesunlight
        surfaceparm landmine
        surfaceparm trans 
        surfaceparm alphashadow 
{
		map textures/desert_sd/sand_disturb_desert.tga
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.090 0.090
	}
	{
		map textures/desert_sd/sand_patchy.tga
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.090 0.090
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
}

textures/test/terrain.vertex
{
	surfaceparm nolightmap
	q3map_novertexshadows
	q3map_forcesunlight
	surfaceparm landmine
        surfaceparm trans 
        surfaceparm alphashadow 
{
		map textures/desert_sd/sand_disturb_desert.tga
		rgbGen vertex
		tcmod scale 0.090 0.090
	}
}

When i launch the game everything is orange and black. Help me plz