Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 2
UV Movement #85251
08/09/06 14:38
08/09/06 14:38
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline OP
Expert
ShoreVietam  Offline 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.

My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
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 Offline OP
Expert
ShoreVietam  Offline 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






My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
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 Offline
Expert
Uhrwerk  Offline
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: Uhrwerk] #85254
08/09/06 18:21
08/09/06 18:21
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline OP
Expert
ShoreVietam  Offline OP
Expert

Joined: Jul 2002
Posts: 2,002
Europe
Here you go!

Video at youtube


I'm open for better solutions, but I think it is not that heavy with a small 32x128 texture and a hand full of polys doing some texture multiplications?


My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
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 Offline
Expert
Uhrwerk  Offline
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 Offline OP
Expert
ShoreVietam  Offline 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.






My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
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
A
Alexander Esslinger Offline
Senior Developer
Alexander Esslinger  Offline
Senior Developer
A

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: Alexander Esslinger] #85258
08/12/06 12:16
08/12/06 12:16
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline OP
Expert
ShoreVietam  Offline OP
Expert

Joined: Jul 2002
Posts: 2,002
Europe
I fear I don't know enough about shaders to understand it, yet.

I gotta look a couple of things up to understand it.






My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
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 Offline OP
Expert
ShoreVietam  Offline 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;
}
}




My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
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 Offline OP
Expert
ShoreVietam  Offline 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 )






My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1