shader to make texture move


(twt_thunder) #1

who’s the shader god around here?

to explain the most easy way…

i want a shader who makes the allied cov ops texture to be waving like the “tents” on oasis spawn for the allied… is it possible…can it be done??? is there anybody here who can help me???H-E-L-P!!:D:mad::eek:


(IndyJones) #2
textures/egypt_props_sd/siwa_canvas1
{
	cull disable
	deformVertexes wave 100 sin 0 2 0 .3
	deformVertexes wave 30 sin 0 2 0 .1
	nofog
	surfaceparm alphashadow
	surfaceparm nomarks
	surfaceparm trans
	tessSize 64
	implicitMap -
}

this is that shader.


(Pande) #3

for you, ignore tessSize since he verts will be close enough together already. tessSize is for large faces that deform badly.


(twt_thunder) #4

sorry guys, not moving enough


(IndyJones) #5

change values.


(kamikazee) #6

[QUOTE=IndyJones;190601]change values.[/QUOTE]As Indy said, start playing with the deformvertexes keyword.

See the Shader manual on deformvertexes for more info.


(twt_thunder) #7

deformVertexes wave 100 sin 0 2 0 .3

the digits in sin what does they do? is it x y z directions or?


(Nail) #8

afaik, in order
"Waveforms all have the following properties:

 [b] base: [/b]Where the wave form begins. Amplitude is measured from this base value.

  [b]amplitude:[/b] This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

 [b] phase:[/b] This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phaseof 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in a shader, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single shader, but with the phases shifted can be used to create interesting visual effects. Example: using rgbGen in two stages with different colors and a 0.5 difference in phase would cause the manipulated texture to modulate between two distinct colors. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate shader for each, changing only the phase value.

 [b] freq:[/b] Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds."

(DerSaidin) #9

RTFM

http://members.lycos.co.uk/quakeroats/q3map2/shader_manual/ch2.html#deformvertexes


(Nail) #10

was my explanation wrong ? if so I’ll remove it, but that’s what I understood them to be


(twt_thunder) #11

do not understand anyhow:(…
need to get it in with a teaspoon…


(Nail) #12

play around with second and forth values


(DerSaidin) #13

It looks ok to me, I was just telling him there’s a manual for it.


(twt_thunder) #14

hahaaha,sorry…didn’t see that link…thanx:D


(Nail) #15

value 2 is amount of movement (extremely simple explanation) value 4 is number of times per second effect takes place (also simple explanation)


(twt_thunder) #16

no…probably something wrong with my eye or the computer…now i’ve tried up to this:

models/players/temperate/allied/cvops/body

{
	cull disable
	deformVertexes wave 64 sin 1 1000 1.0
	deformVertexes wave 64 sin 1 1000 1.0
	nofog
	surfaceparm alphashadow
	surfaceparm nomarks
	surfaceparm trans
	implicitMap -
}

but nothing seems to happend…


(Nail) #17

try 0 3 0 .4


(IndyJones) #18

i think it’s a bit pointless to have two exacly the same values.


(Nail) #19

as they pertain to two different functions, no it isn’t imo


(IndyJones) #20

i meant this:

deformVertexes wave 64 sin 1 1000 1.0
deformVertexes wave 64 sin 1 1000 1.0