How do I offset a projected texture?


(DickDastardly) #1

I’m using the following shader for a phong shaded texture which is projected on the x-axis:

textures/aamjs_misc/barseatredlthr
{
q3map_nonplanar
q3map_shadeangle 160
q3map_tcGen ivector ( 0 96 0 ) ( 0 0 24 )
q3map_lightmapaxis x
{
map textures/aamjs_misc/barseatredlthr.tga
rgbGen identity
}
{
map $lightmap
tcGen lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}

The size and appearance of the texture is fine, but I want to offset it so that rather than being aligned with the origin of the map, it aligns with a point 606 units along the y-axis and 28 units along the z-axis. Can anyone tell me what I need to add to the shader to achieve this? (I’ve tried trawling through these forums and the manual, but I couldn’t find anything that seemed to fit the bill).
Thanks in advance,
DD


(ydnar) #2

q3map_tcMod translate S T

or

q3map_tcMod shift S T

or

q3map_tcMod offset S T

Either one of those works. Note it is in texture space, so a value of 1 will be indiscernable from a normal projection, and a value of 0.5 will shift the texture halfway.

y


(DickDastardly) #3

That’s just what I was after, cheers m8.