grates casting shadows


(BillyBob) #1

How do i get my grate textures to cast shadows. The shader file i currently have is:

textures/bill_tex/grate01
{
	cull disable
	{
		map textures/bill_tex/grate01.tga
		rgbGen identity
		depthWrite
		alphaFunc GE128
	}
	{
		map $lightmap 
		blendfunc filter
		rgbGen identity
		tcGen lightmap 
		depthFunc equal
	}
}

I think i must be missing something. I have made the surface the shadow is falling on a func_group with a _lightmapscale of 0.25

Thanks for any help :moo:


(Old_Fellow) #2
textures/bill_tex/grate01
{
surfaceparm metalsteps //option.
surfaceparm alphashadow	
surfaceparm nomarks
cull disable
	{
		map textures/bill_tex/grate01.tga
		rgbGen identity
		depthWrite
		alphaFunc GE128
	}
	{
		map $lightmap 
		blendfunc filter
		rgbGen identity
		tcGen lightmap 
		depthFunc equal
	}
}

From the shader manual:

alphashadow
This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map process to use the texture’s alpha channel as a mask for casting static shadows in the game world.


(SCDS_reyalP) #3

In addition to alphashadow, you might want to increase the lightmap resolution on the brushes that will recieve the shadow. See _lightmapscale in the q3map2 manual.


(BillyBob) #4

thanks for your help, i guess i should have looked in the shader manaul befor asking on here, i have got it working now. i already knew about _lightmapscale and had it set to 1.25
thanks


(Emon) #5

Erm, that will decrease the size of the lightmaps and decrease the quality… Set it to lower than one.


(BillyBob) #6

opps i meant 0.125


(Emon) #7

And that will make the lightmaps really huge and increase the quality way too much and make compiling slower and you’ll loose some performance… Not to mention it won’t be consistant with the rest of the level if you go too low (consistancy is one of the most important things to me).

I’d recommend .75 or .5.