changing texture on water?


(twt_thunder) #1

let’s say i got 6 water textures

and i wanna change them … ah how should i explain this…

lets try this the texture should go 1-wait-2-wait-3-wait and so on and looped…

any ideas?


(IndyJones) #2

animmap as far as i remember.


(Wezelkrozum) #3

Take a look in the water of Cathare or in my Scene From Contest entry.
You will find this command (rgbGen) which will make your texture fade looping from visible to invisible to visible and so on.

And that fading in and out will make the water look more natural than the animap command!

Also important, the 3th variable is the starttime. I had 3 textures so I had the starttimes 0 / 0,333 / 0,666

Here is the whole watershader (bold section are the fading textures):


textures/terrain_dm_castle/water
{
	qer_editorimage textures/terrain_dm_castle/water1.tga
	qer_trans .5
	q3map_globaltexture
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm water
	surfaceparm nomarks

	cull none
	nopicmip
	nomipmap
	nofog

	deformVertexes wave 160 sin 0 3 0 0.3
	q3map_tcMod rotate 20

	{
		map textures/terrain_dm_castle/water2.tga

		blendFunc blend
		alphaFunc GT0

		rgbGen identity
		rgbGen wave sin .4 .6 .6 0

		tcmod turb .01 .05 0 .1
		tcmod scale 0.4 0.4
		tcmod scroll .02 -.001
	}
	{
		map textures/terrain_dm_castle/water3.tga

		detail
		blendFunc blend
		alphaFunc GT0

		rgbGen identity
		rgbGen wave sin .2 .8 .5 0

		tcmod turb .01 .05 .25 .1
		tcmod scale 1.4 1.5
		tcmod scroll -.018 .002
	}
[B]	{
		map textures/terrain_dm_castle/water_ref1.tga
		blendFunc GL_ONE GL_ONE
		detail
		rgbGen identity
		rgbGen wave sin .1 .1 .333333333333 1
		tcMod scale .25 .25
		tcmod scroll .014 -.01
	}
	{
		map textures/terrain_dm_castle/water_ref2.tga
		blendFunc GL_ONE GL_ONE
		detail
		rgbGen identity
		rgbGen wave sin .1 .1 0 1
		tcMod scale .25 .25
		tcmod scroll .015 .01
	}
	{
		map textures/terrain_dm_castle/water_ref3.tga
		blendFunc GL_ONE GL_ONE
		detail
		rgbGen identity
		rgbGen wave sin .1 .1 0.666666666666 1
		tcMod scale .25 .25
		tcmod scroll .016 0
	}
}[/B]

You should adjust the other variable in the “rgbGen wave sin” command. You can find the definition of the values on www.wezelkrozum.com under Usefull stuff > Shader Manual > Quake 3 Version
There you will find the following shader command and their definitions:

6.3.3 rgbGen wave <func> <base> <amp> <phase> <freq>
Colors are generated using the specified waveform. An affected texture with become darker and lighter, but will not change hue. Hue stays constant. Note that the rgb values for color will not go below 0 (black) or above 1 (white). Valid waveforms are sin, triangle, square, sawtooth and inversesawtooth.

<func> Wave forms and their effects:

Sin: color flows smoothly through changes.
Triangle: color changes at a constant rate and spends no appreciable time at peaks and valleys.
Square: color alternates instantly between its peak and valley values.
Sawtooth: With a positive frequency value, the color changes at a constant rate to the peak then instantly drops to its valley value.
Inversesawtooth: An inverse sawtooth wave will reverse this, making the ascent immediate (like a square wave) and the decay fall off like a triangle wave.

<base> Baseline value. The initial RGB formula of a color (normalilzed.
<amp> Amplitude. This is the degree of change from the baseline value. In some cases you will want values outside the 0.0 to 1.0 range, but it will induce clamping (holding at the maximum or minimum value for a time period) instead of continuous change.
<phase> See the explanation for phase under the waveforms heading of Key Concepts.
<freq> Frequency. This is a value (NOT normalized) that indicates peaks per second.

Good Luck with it! Greetz, Wezelkrozum.


(twt_thunder) #4

the REF pictures is the ones making the shimmer and suff?


(Wezelkrozum) #5

Yes the ref1,2 and 3.


(twt_thunder) #6

@wezelkrozum thanx a lot, i’ll look into it… i want to make a river that actually moves like it should and look like water :smiley: