Shift texture for sky shader


(leifhv) #1

I’m sure the solution to this is obvious…but not to me.

The texture for my sky shader wraps around…thats ok, but I’d like to shift the texture a bit downwards so that the ‘wrapped around part’ is not visible.

For normal textures in Radiant this is easy enough…press ‘S’ and adjust the shift values. But how can this be done with the texture in a shader?

Here is how it looks now (well, the texture that need shifting at least…ignore the terrible colours!):

See that black area behind the structure…I’d like to move that further down!

And here is the shader (with not relevant stuff removed):


textures/lhv/lhvsky
{
	nocompress
	qer_editorimage textures/skies/sky_8.tga
	q3map_lightimage textures/skies/n_blue2.tga
	q3map_nofog
	q3map_globaltexture
	q3map_lightsubdivide 256 
	q3map_sun    0.99 0.53 0.16 70 180 10
	q3map_surfacelight 50

	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm sky

	skyparms - 512 -
	sunshader textures/lhv/latesun

	{
		//map textures/skies_sd/wurzburg_clouds.tga
		map textures/lhv/lh_sky2.tga
		tcMod scale 1 15
		//tcMod scale 1.0 1.0
		//tcMod scroll 0.003 -0.0015
		tcMod transform 1 0 0 1 -1 -1
		rgbGen identityLighting
	}
}

leifhv


(badong) #2

first of all replace q3map_surfacelight with q3map_skylight. Also you might wanna use q3map_sunExt instead of q3map_sun, but this is not that important. Check the shader manualfor the description of those commands if you don’t know what they do.
Now to the texture problem…Please replace that screenie with one with r_showtris 1 on. From what i can tell from it it looks like the black portion is the bottom brush of your sky box. If so there’s no way to make the sky extend to it. You have to modify the skybox brushes …maybe push the bottom brush even further down and extend the side brushes to the point where you can’t see the bottom brush anymore,…but again I can’t really tell what’s going on from the screenshot.


(leifhv) #3

Thanks, I’ll check out your suggestions for changes to the shader!

Here is a screenshot with r_showtris=1…and from another angle so that you can see the bottom of the skybox.

It’s not the bottom of the skybox showing…and as you can see the whole texture should be shifted downwards. Maybe that’s not possible?

Increasing the height of the skybox (downwards) might help…that’s one thing I haven’t tried yet.

leifhv


(badong) #4

ok i see…
I’m pretty sure the problem is caused by the tcMod transform command. It’s very hard to understand how this command works and find the right parameters for it.
My advice is keep messing with the parameters of tcMod transform(or maybe remove it completely) until you find something that works. It shouldn’t be very hard since it’s a runtime command and all you gotta do is reload the map to view the changes(no compiling necessary)


(leifhv) #5

Well, I’m not sure…it’s there since this shader started as a copy of the Radar sky shader. (If I remember correctly…)

For nocompress I’m guessing it specifies that the driver should not use any compression on the textures during transfer to the gfx card…?

lh04