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, Ayumi), 1,405 guests, and 4 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 2 of 2 1 2
Re: Wellen-Shader auch bei älteren computern? [Re: R4v3n] #42396
03/11/05 22:15
03/11/05 22:15
Joined: Sep 2004
Posts: 128
R4v3n Offline OP
Member
R4v3n  Offline OP
Member

Joined: Sep 2004
Posts: 128
AHHHHHHHHHHHHHHHHHHHHHH.... seine schei... demo.exe da geht der shader... aber wenn ich einfach das water.wdl include... sieht man überhaupt keine wellen hrmpf

Re: Wellen-Shader auch bei älteren computern? [Re: R4v3n] #42397
03/11/05 22:19
03/11/05 22:19
Joined: Sep 2004
Posts: 128
R4v3n Offline OP
Member
R4v3n  Offline OP
Member

Joined: Sep 2004
Posts: 128
Edit2: Klar doch... jeztt geht blatsalats Multi Texturing nimmer^^

Sry wegen Spamm, aber koennt ihr mir beantworten... also in zwischen geht es... aber warum nur bei Terrain?

Edit : Also nun gehts ja .
Danke an alle. Aber wie kann ich nun die Wellen kleiner machen?

code :
/******************************************************
Water Shader for 3DGameStudio

By: Eric Hendrickson-Lambert (Steempipe)

v11.08.04.1

11/08/04: Cleaned up code for release.

Note: Pixelshader1.1 & DX9.00c Runtimes needed.

It will take experimenting with
scaling, shifting, etc~ depending on
what normalmap is used. The ripple
code is still in very early stages.

-See the main WDL for loading the material effect
and the d3d_shaderversion function.

If used, credit would be nice... these take alot
of time to work out. Thanks.

******************************************************/

float4x4 matWorldViewProj;
float4x4 matWorld;
float4x4 matWorldView;

float3 vecViewPos;
float3 vecSkill41;
float4 vecFog;

float RippleScale = 0.28;

Texture mtlSkin1; // Normalmap
Texture mtlSkin2; // Cubemap


sampler s_Bump = sampler_state
{
Texture = (mtlSkin1);
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = WRAP;
AddressV = WRAP;
};

sampler s_Cube = sampler_state
{
Texture = (mtlSkin2);
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
};

struct VS_IN
{
float4 Pos: POSITION;
float3 Normal: NORMAL;
float2 Bump: TEXCOORD0;
float3 Tangent : TEXCOORD1;

};


struct VS_OUT
{
float4 Pos: POSITION;
float Fog: FOG;
float2 Bump: TEXCOORD0;
float4 TanToCube0: TEXCOORD1;
float4 TanToCube1: TEXCOORD2;
float4 TanToCube2: TEXCOORD3;
};


VS_OUT WaterBump_VS(VS_IN IN)
{
VS_OUT Out;

Out.Pos = mul(IN.Pos, matWorldViewProj);

////////////////////////////////////////////////////////////////////////////////
// Ripple Test #1
//
//Out.Bump= (IN.Bump.xy * RippleScale) + (IN.Bump.xy += (vecSkill41.x * 0.2));
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
// Ripple Test #2
//
//float cos_x = cos(RippleScale * vecSkill41.x);
//float sin_y = sin(RippleScale * vecSkill41.x);
//Out.Bump = float2(IN.Bump.x+cos_x, IN.Bump.y-sin_y);
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Ripple Test #3
//
float cos_x=cos(vecSkill41);
float sin_y = sin(vecSkill41);
Out.Bump = (float2(IN.Bump.x+cos_x, IN.Bump.y+sin_y)* RippleScale)*0.2;


float3x3 ObjToTan;

ObjToTan[0] = RippleScale * IN.Tangent;
ObjToTan[1] = RippleScale * cross(IN.Tangent, IN.Normal);
ObjToTan[2] = IN.Normal;

Out.TanToCube0.xyz = mul(ObjToTan, matWorld[0].xyz);
Out.TanToCube1.xyz = mul(ObjToTan, matWorld[1].xyz);
Out.TanToCube2.xyz = mul(ObjToTan, matWorld[2].xyz);


float3 PositionWorld = mul(IN.Pos, matWorld);
float3 ViewerDir = normalize(vecViewPos - PositionWorld);

Out.TanToCube0.w = ViewerDir.x;
Out.TanToCube1.w = ViewerDir.y;
Out.TanToCube2.w = ViewerDir.z;

float ofog = 1 - (distance(PositionWorld, vecViewPos) - vecFog.x) * vecFog.z;
Out.Fog = ofog;

return Out;
}


technique WaterBump
{

pass One
{
Sampler[0] = (s_Bump);
//Sampler[1] = (s_Cube);
//Sampler[2] = (s_Cube);
Sampler[3] = (s_Cube);

AlphaBlendEnable = True;
ZwriteEnable = True;
ZEnable = True;


// Main point is that pixelShaderConstant 'W' will control
// the alpha tranparency. The XYZ will adjust
// some coloring.

PixelShaderConstant[0] = {0.80,0.80,0.92,0.88}; // x, y, z, w

VertexShader = compile vs_1_1 WaterBump_VS();


PixelShader =
asm
{
ps.1.1

tex t0 // Normalmap


texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2

mul r0, t3, c0

};
}
}

Last edited by R4v3n; 03/11/05 22:54.
Re: Wellen-Shader auch bei älteren computern? [Re: R4v3n] #42398
03/12/05 07:53
03/12/05 07:53
Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
S
Sebe Offline
Serious User
Sebe  Offline
Serious User
S

Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
Nimm die Normalmap (die bestimmt die "Wellen") und verkleinere sie z.B. von auf 256x256 auf 128x128. Dann machst du ein neues 256x256 File und fügst die verkleinerte Normalmap dort 4mal ein => fertig sind die kleineren Wellen. Die sind dann allerdings weniger detailliert. Hoffe dass es geht

Re: Wellen-Shader auch bei älteren computern? [Re: Sebe] #42399
03/12/05 16:40
03/12/05 16:40
Joined: Sep 2004
Posts: 128
R4v3n Offline OP
Member
R4v3n  Offline OP
Member

Joined: Sep 2004
Posts: 128
man das sagte chb2 auch schon aber bei mir is gar keine textur dabei die textur steht irgendwo im script... also soll ich als normal map einfach was schwarzes machen? oder wat?

Re: Wellen-Shader auch bei älteren computern? [Re: R4v3n] #42400
03/12/05 19:51
03/12/05 19:51
Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
S
Sebe Offline
Serious User
Sebe  Offline
Serious User
S

Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
Ohne normalmap hat es gar keine Wellen bzw. ohne normalmap im Ordner bekommst du garantiert eine Fehlermeldung. Wenn du also keine bekommst, ist sie bestimmt vorhanden. Möglicherweise als Skin des Wasserterrains.

Re: Wellen-Shader auch bei älteren computern? [Re: Sebe] #42401
03/12/05 20:27
03/12/05 20:27
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
raven... BITTE benutze mal die EDIT function!


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Wellen-Shader auch bei älteren computern? [Re: Michael_Schwarz] #42402
03/12/05 20:39
03/12/05 20:39
Joined: Sep 2004
Posts: 128
R4v3n Offline OP
Member
R4v3n  Offline OP
Member

Joined: Sep 2004
Posts: 128
ok xwcg ich werde spamm stoppen, dann sag das aber auch mal dem les_c oder wie der heisst.
Ausserdem, was denn für ne skin ich sehe GROSSE wellen, jetzt denkt doch mal nach ey.. das muss im Script liegen.

Re: Wellen-Shader auch bei älteren computern? [Re: R4v3n] #42403
03/12/05 20:42
03/12/05 20:42
Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
S
Sebe Offline
Serious User
Sebe  Offline
Serious User
S

Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
Ich meinte eher den 2nd Skin, die normalmap ist nie als 1st Skin vorhanden. Ansonsten muss, damit es keine Fehlermeldung beim Start des Levels gibt, eine Normalmap in deinem Ordner vorhanden sein. Such einfach nochmals genau nach. Und nein, am Script liegt es bestimmt nicht

Re: Wellen-Shader auch bei älteren computern? [Re: Sebe] #42404
03/12/05 22:27
03/12/05 22:27
Joined: Nov 2003
Posts: 1,267
ef
C
Christoph_B Offline
Serious User
Christoph_B  Offline
Serious User
C

Joined: Nov 2003
Posts: 1,267
ef
ja, die is im ordner, und heißt "waterbump5.tga".
um ne neue zu machen brauchst du dieses nvidia photoshop plugin.


sef
Re: Wellen-Shader auch bei älteren computern? [Re: Christoph_B] #42405
03/13/05 05:42
03/13/05 05:42
Joined: Sep 2004
Posts: 128
R4v3n Offline OP
Member
R4v3n  Offline OP
Member

Joined: Sep 2004
Posts: 128
Sehr merkwürdig. Komischer weisser is die Bumbmapping datei genau die Datei... die bei mir fast allen Bump-Mapping Shadern da is. Ausserdem müssen se dem Bumpmapping.bmp nach kleine Wellen sein... ach ja... die Wellen gehen schon... aber keine Skin is vorhanden.

Page 2 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