water-shader: direction of scrolling gives me a headache


(]UBC[ McNite) #1

First, a pic:

To get a goodlooking river in my map I took the siwa_water.tga, messed around with it for a decent coloring, and then used the complete siwa-watershader on it, which looks like this now:

// after siwa_water2

textures/river2nd_t/rv2nd_water
{
	qer_editorimage textures/river2nd_t/rv2nd_water.tga
	qer_trans .5
	q3map_globaltexture
	cull disable
	nocompress
	nofog
	surfaceparm nomarks
	surfaceparm nonsolid
//	surfaceparm trans
	surfaceparm water
	waterfogvars ( 0.11 0.13 0.15 ) 0.2
	nopicmip
	{
		map textures/river2nd_t/rv2nd_water.tga
		blendFunc blend
		alphaFunc GE128
		rgbgen identity
		tcmod scale 1 1 //0.5 0.5
		tcmod scroll -0.2 -0.1//-.02 -.001
		fog on
	}
(...)
	{
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.1 0.03 0 0.4
		tcmod scale 0.8 0.8 //1 1
		tcmod scroll -.003 -.002 //.005 .003
		fog on
	}
}

My prob is this:
The block with the seawall_ripple.tga (with the tcmod scale 0.8 0.8) is the one that is responsible for the large white patches on the surface. It is scrolling with the right speed, but not the right direction. And its always scrolling in the same direction, no matter whether I use a “-” or not :angry:
With this setting its scrolling from upper left corner of command map to lower right one… I want it from upper right to lower left.
HEAALLLLPPP!!!

Btw: does anybody know how to get such fuzzy patterns as used in the seawall_ripple.tga? I m sure its something in photoshop, it doesn’t look handmade. The prob with the seawall_ripple is that is has 1 area with very large distances between the white lines, and its noticeable on the river with its dark water-surface.


(Vitriol) #2

have you tried rotating the water shader using the texture editor screen thingy (when you hit s)?


(]UBC[ McNite) #3

Just an idea that would make things easier… is it possible to make a texture rotating? Has anybody and idea how it would affect the game performance (after all its a large surface)?


(G0-Gerbil) #4

Easiest way to sort it is to have two copies of your water texture - one with big arrows pointing in the direction of travel.
Use this as the editor only image, then rotate it in radiant to match what you want.


(]UBC[ McNite) #5

Solution: I was wrong about which scripting-block is responsible for the large ripples.

	{
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.3 0.02 0 0.25
		tcmod scale 0.01 0.01 // me: 0.04 0.05
		tcmod scroll .005 -.004 // -.001 -.0002
		fog on
	}
	{
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.1 0.03 0 0.4
		tcmod scale 0.8 0.8 //1 1
		tcmod scroll .003 .002 //old:.005 .003
		fog on
	}

I thought it was the 2nd one, but the large ripples are done by the first one. What mislead me was the tcmod scale, assuming that a large number (0.8) means a large “stretching” of the texture. But its this way: the smaller the number after the tcmod scale, the larger the texture appears in the game.
So I messed with the tcmod scroll of the wrong texture… no wonder nothing happened :smiley: