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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,184 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Shader Based Water Fx #17765
10/02/03 04:18
10/02/03 04:18
Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
myrlyn68 Offline OP
Senior Expert
myrlyn68  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 2,826
Margaritaville (Redneck Rivier...
As opposed to hijacking a post (my bad Ventilator...) a new thread should be created.

The demo found here on ATI's website should be easy enough to do with 3DGS. While I haven't seen any realease notes other then the Beta for the A6 shaders, all the commands used are pretty standard. The biggest benefit here, is the bump mapping (to create waves) and then applying a bit of a pixel shader on the high spots. It gives a very nice appearance.

To really sweeten the pot, you will also want to take a look at this (password required). It will allow you to take the light from the surface - refract it through your wave patterns and generate the light/dark spots on the floor of your body of water. Unfortunately the procedure used there does require DX9. Not that big of a deal though, as it can be done with a few tweaks using DX8 compatable shaders.

Granted since I don't have the Beta, I can't really say what is fully supported with A6 shaders, but I am assuming that it will have no problems with standard DX functions. Just something for you guys to run with while we wait.


Virtual Worlds - Rebuilding the Universe one Pixel at a Time. Take a look - daily news and weekly content updates.
Re: Shader Based Water Fx [Re: myrlyn68] #17766
10/02/03 05:50
10/02/03 05:50
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
the problem is that most ati shaders use pixelshader version 1.4 which is much more powerful than version 1.3! so this effect would have to be simplified for geforce3/4 cards. and the current beta doesn't yet support environment cube textures. i think they are needed for good water effects.

Re: Shader Based Water Fx [Re: ventilator] #17767
10/02/03 07:52
10/02/03 07:52
Joined: Oct 2001
Posts: 395
Arlington Heights, IL USA
cbw Offline
Senior Member
cbw  Offline
Senior Member

Joined: Oct 2001
Posts: 395
Arlington Heights, IL USA
Think it might be possible though Ventilator?


Greg Szemiot, Lead Designer, Orb Crossbeam Studios Entertainment
Re: Shader Based Water Fx [Re: cbw] #17768
10/02/03 08:43
10/02/03 08:43
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
sure, it will be possible to use that shader but only with ati (or dx9) cards! one of the next betas will support environment cube textures... but i think for geforce3/4 cards you will have to use a simpler pixelshader. i have seen impressive water on geforce3/4 cards too though!

Re: Shader Based Water Fx [Re: ventilator] #17769
10/03/03 04:25
10/03/03 04:25
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Here's my favorite water screenshot, but I don't know if it is real-time:
http://www.peroxide.dk/era/screenshots/Work%20in%20Progress/Coastline.jpg

I don't see why the ATI algorithm should not work with earlier PS versions as well. The tricky part will be having real-time environment maps that contain models and not just the sky.

Re: Shader Based Water Fx [Re: Marco_Grubert] #17770
10/03/03 05:30
10/03/03 05:30
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
the muddy water is nice! ...i only had a quick look at the ati shader. it uses 2 phases and more than 8 arithmetic commands so i thought it needs simplifications for 1.3. but i haven't tried to understand it yet!

Quote:

The tricky part will be having real-time environment maps that contain models and not just the sky.


i think that's only tricky for jcl. for doing the shader it will be no difference?

Re: Shader Based Water Fx [Re: myrlyn68] #17771
01/03/04 07:36
01/03/04 07:36
Joined: Oct 2001
Posts: 395
Arlington Heights, IL USA
cbw Offline
Senior Member
cbw  Offline
Senior Member

Joined: Oct 2001
Posts: 395
Arlington Heights, IL USA
So I got the Shader ATI used in their nature demo, but for some reason it doesn't work. It's DX 8.0, but it just gives me errors.

Any help?

matrix matWorldViewProj;
matrix matWorldView;

technique water
{
pass p0
{
ZWriteEnable=true;
AlphaTestEnable=true;
CullMode=none;



VertexShader=
decl
{
stream 0;
float v0[3]; //position
float v3[3]; //normal
float v7[2]; //uv
}
asm
{
vs.1.1
mul r0, c14, v7.x
mad r0, c15, v7.y, r0

mov r1, c16.x
mad r0, r1, c13, r0
add r0, r0, c12
frc r0.xy, r0
frc r1.xy, r0.zwzw
mov r0.zw, r1.xyxy

mul r0, r0, c10.x

sub r0, r0, c0.y
mul r0, r0, c1.w

mul r5, r0, r0
mul r1, r5, r0
mul r6, r1, r0
mul r2, r6,r0
mul r7, r2, r0
mul r3, r7, r0
mul r8, r3, r0

mad r4, r1, c2.y, r0
mad r4, r2, c2.z, r4
mad r4, r3, c2.w, r4

mov r0, c0.z
mad r5, r5, c3.x, r0
mad r5, r6, c3.y, r5
mad r5, r7, c3.z, r5
mad r5, r8, c3.w, r5

dp4 r0, r4, c11

mul r0.xyz, c0.xxzx, r0
add r0.xyz, r0, v0
mov r0.w, c0.z

m4x4 oPos, r0, c4

mul r1, r5, c11
dp4 r9.x, -r1, c14
dp4 r9.yzw, -r1, c15
mov r5, c0.xxzx
mad r5.xy, r9, c10.y, r5

mov r4, v9
mad r4.z, -r9.x, c10.y, r4.z
dp3 r10.x, r5, r5
rsq r10.y, r10.x
mul r5, r5, r10.y

dp3 r10.x, r4, r4
rsq r10.y, r10.x
mul r4, r4, r10.y
mul r3, r4.yzxw, r5.zxyw
mad r3, r4.zxyw, -r5.yzxw, r3
sub r1, c9, r0
sub r2, c8, r0
dp3 r10.x, r1, r1
rsq r10.y, r10.x
mul r1, r1, r10.y
dp3 r6.x, r1, r3
dp3 r6.y, r1, r4
dp3 r6.z, r1, r5
dp3 r10.x, r2, r2
rsq r10.y, r10.x
mul r2, r2, r10.y

dp3 r7.x, r2, r3
dp3 r7.y, r2, r4
dp3 r7.z, r2, r5

mov r0, c16.x
mul r0, r0, c24
frc r0.xy, r0
mul r1, v7, c26

add oT0, r1, r0
mov r0, c16.x
mul r0, r0, c25
frc r0.xy, r0
mul r1, v7, c27

add oT1, r1, r0
dp4 r0.x, v0, c20
dp4 r0.y, v0, c21
dp4 r0.zw, v0, c22

mov oT2, r0

mov oT3, r7
mov oT4, v7
mov oT5, r6
};

PixelShader=
asm
{
ps.1.4
texld r0, t0
texld r1, t1

texcrd r2.xy, t2_dw.xyw
texcrd r4.xyz, t3
texcrd r5.xyz, t5

add_d2 r1.rgb, r0_bx2, r1_bx2

mov r3.xy, r2

dp3 r0.r, r4, r1
dp3 r0.g, r1, r5

mad_sat r5.rg, r1, c2, r3
mad_sat r4.rg, r1, c1, r3

phase

texcrd r0.rgb, r0

texld r2, r4
texld r3, r5

mul_sat r2.rgb, r3, c3
+mul r2.a, r0.g, r0.g

mul_sat r3.rgb, r3, c4
+mul_sat r2.a, r2.a, r2.a

mad_sat r0.rgb, 1-r0.r, r2, r3
+mul_sat r2.a, r2.a, r2.a

mad_sat r0.rgb, r2.a, c6, r0
+mov r0.a, r0.r
};
}
}



Greg Szemiot, Lead Designer, Orb Crossbeam Studios Entertainment
Re: Shader Based Water Fx [Re: myrlyn68] #17772
01/12/04 02:16
01/12/04 02:16
Joined: Jul 2002
Posts: 1,364
Minbar
M
MaxF Offline
Serious User
MaxF  Offline
Serious User
M

Joined: Jul 2002
Posts: 1,364
Minbar
Hi All

I opened the Project/Solution in MS Visual Studio and got errors after compiling, opened it in MSVS 6.0 and it was fine.

It's looks GREAT, How can one set this up in 3DGS, I know which parts are shaders and which are C++.

Do we have a tutorial on "how to implementation shaders in 3dGS", I can't fine one on here?


Re: Shader Based Water Fx [Re: myrlyn68] #17773
01/17/04 03:36
01/17/04 03:36
Joined: Aug 2003
Posts: 52
Netherlands
VoodooFactory Offline
Junior Member
VoodooFactory  Offline
Junior Member

Joined: Aug 2003
Posts: 52
Netherlands
Is there anyone who's actually made a working watershader? Using environment mapping and bumbmapping for example.

Re: Shader Based Water Fx [Re: VoodooFactory] #17774
01/18/04 03:49
01/18/04 03:49
Joined: Oct 2001
Posts: 395
Arlington Heights, IL USA
cbw Offline
Senior Member
cbw  Offline
Senior Member

Joined: Oct 2001
Posts: 395
Arlington Heights, IL USA
apparently the shader above works, it's just my video card doesn't support it, try it out.


Greg Szemiot, Lead Designer, Orb Crossbeam Studios Entertainment
Page 1 of 2 1 2

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