2 registered members (dr_panther, 7th_zorro),
1,203
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
UV Movement
#85251
08/09/06 14:38
08/09/06 14:38
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
OP
Expert
|
OP
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
hi there I just try some stuff and need a constant U/V movement, but the article/ tutorial in the wiki covering this has been deleted and I can't find information about doing U/V Movement within a shader (only one of 2 textures has to be shifted). If someone knows it, please tell me, thanks. ^.^" I'll share it, too, if it works. Edit: Got it, only some tweaking left. :-]
Last edited by ShoreVietam; 08/09/06 15:57.
|
|
|
Smothly blendet streaming water
[Re: ShoreVietam]
#85252
08/09/06 17:00
08/09/06 17:00
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
OP
Expert
|
OP
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
My shader is finished, yay! Here's how it looks like, I think everyone has seen it in games before. Water floating around a stone or something else: If you want to use it just download the resources including the wdl file, the .fx file, a demo model and pictures how to build the alpha map of your own water stream. I got the best visual results by placing the model a few quants below the water. Doublealpha.exe ~ 66.7 KB Selfextracing WinRAR Archive
|
|
|
Re: Smothly blendet streaming water
[Re: ShoreVietam]
#85253
08/09/06 17:23
08/09/06 17:23
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Would you mind posting a little vid in order to show, what the effect exactly does? I understand in base what you wanted to achieve, but I'm in doubt if I should use a ps/vs 2.0 effect for such an "easy" eyecandy...
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Smothly blendet streaming water
[Re: ShoreVietam]
#85255
08/09/06 21:08
08/09/06 21:08
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
I don't know if this solution is fast or not. I haven't got my feets wet in shader stuff. The thing that bothers me, is that you require a ps/vs 2.0 capable graphics card to see the effect in action.
However, the effect looks really nice. Thank you for making the video so fast and last but not least for the contribution itself.
regards, Zeitwerk.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Smothly blendet streaming water
[Re: Uhrwerk]
#85256
08/10/06 06:21
08/10/06 06:21
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
OP
Expert
|
OP
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
I just tested something, you could reduce VS to 1.0, but PS 2.0 is needed to shift the texture. I'm sure the way I made it is more complicated than how it could be made, but I'm not really inter shader programming... However you could make smooth waterfalls, too. I'll use it until I (or maybe someone else) find a better solution.
|
|
|
Re: Smothly blendet streaming water
[Re: ShoreVietam]
#85257
08/10/06 12:15
08/10/06 12:15
|
Joined: Oct 2000
Posts: 1,543 Germany
Alexander Esslinger
Senior Developer
|
Senior Developer
Joined: Oct 2000
Posts: 1,543
Germany
|
When you need ps2.0 you're using complicated dependant texture-reads - by altering the texture coordinates in the vertex-shader you can use ps1.1. But you can also use the directx renderstates: FX-file Code:
matrix matMtl; texture entSkin1; texture entSkin2;
Technique shift_uv { Pass p0 { Texture[0] = <entSkin1>; Texture[1] = <entSkin2>;
TextureTransform[1] = <matMtl>; TextureTransformFlags[1] = Count2;
ColorOp[0] = SelectArg1; ColorArg1[0] = Texture; ColorOp[1] = Add; ColorArg1[1] = Texture; ColorArg2[1] = Current;
ColorOp[2] = Disable; } }
C-script Code:
.. var phi = 0; while(1) { phi += 1*time; mat_identity(mtl_shiftuv.matrix); mtl_shiftuv.matrix13 = floatd(phi,255); // x-direction mtl_shiftuv.matrix23 = floatd(phi,255); // y-direction wait(1); } ..
|
|
|
Re: Smothly blendet streaming water
[Re: ShoreVietam]
#85259
08/12/06 20:23
08/12/06 20:23
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
OP
Expert
|
OP
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
Got it. That's the ticked, tomorrow I'll upload an updated version: (The cost is the necessity of 2 tga textures) Code:
matrix matMtl; texture entSkin1; texture entSkin2;
Technique fluid_shift { Pass p0 { Texture[0] = <entSkin2>; Texture[1] = <entSkin1>;
TextureTransform[1] = <matMtl>; TextureTransformFlags[1] = Count2;
ColorArg1[0] = Texture; ColorArg1[1] = Current; ColorOp[1] = Modulate; ColorArg2[1] = Texture;
AlphaArg1[0] = Texture; AlphaOp[0] = SelectArg1;
AlphaArg1[1] = Current; AlphaOp[1] = Modulate; AlphaArg2[1] = Texture;
ColorOp[2] = Disable; AlphaOp[2] = Disable; } }
|
|
|
Smothly blendet streaming water (FFP)
[Re: ShoreVietam]
#85260
08/13/06 10:06
08/13/06 10:06
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
OP
Expert
|
OP
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
With thanks to Alexander I finished the new code yesterday. Now I put all new data into the WinRAR archive which can be downloaded now. It uses Fixed Function Pipeline now and thus should run on non-shader graphic cards, too, right? (@Alexander: Ich wohne in Esslingen )
|
|
|
|