Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
water reflection shader error... #59744
11/28/05 09:46
11/28/05 09:46
Joined: Oct 2003
Posts: 702
Z
zazang Offline OP
User
zazang  Offline OP
User
Z

Joined: Oct 2003
Posts: 702
Hi!

I tested the excellent water reflection shader made by Oliver_s and modified
by Sorceror and Matt to include the alpha,however I'm getting some very weird
errors.

As you can see in this screen the red circled entities have become completely dark and also some entities in the level have totally disappeared.
Also at bottom corner of the screen there was a panel,which is partially visible now.Removing the shader does not cause any bug.

What could cause such an error.It just seems like a small fix somewhere and I hope someone can help me.



Best regards
zazang

Re: water reflection shader error... [Re: zazang] #59745
11/29/05 13:55
11/29/05 13:55
Joined: Mar 2004
Posts: 202
Germany
zSteam_ Offline
Member
zSteam_  Offline
Member

Joined: Mar 2004
Posts: 202
Germany
we can't help you without your script


A6 Commercial 6.50.6
Re: water reflection shader error... [Re: zSteam_] #59746
12/03/05 12:42
12/03/05 12:42
Joined: Sep 2005
Posts: 139
destruktor Offline
Member
destruktor  Offline
Member

Joined: Sep 2005
Posts: 139
i think there is a problem with nividia cards like geforce 4 etc.

Re: water reflection shader error... [Re: destruktor] #59747
12/09/05 12:58
12/09/05 12:58
Joined: Mar 2003
Posts: 1,095
Germany
nightshade Offline
Serious User
nightshade  Offline
Serious User

Joined: Mar 2003
Posts: 1,095
Germany
which 3dgs version do you have?

Re: water reflection shader error... [Re: nightshade] #59748
12/09/05 13:15
12/09/05 13:15
Joined: Oct 2003
Posts: 702
Z
zazang Offline OP
User
zazang  Offline OP
User
Z

Joined: Oct 2003
Posts: 702
Well we have the A6 pro 6.31.4 and the latest Dirtect X.
Besides we are testing on ATI Radeon 9600 XT

Re: water reflection shader error... [Re: zazang] #59749
12/10/05 18:21
12/10/05 18:21
Joined: Nov 2005
Posts: 62
Seriff Offline
Junior Member
Seriff  Offline
Junior Member

Joined: Nov 2005
Posts: 62
Please give us the script, i thins that theres a retray beam with the reflect texture... is that a realtime reflection shader?

Re: water reflection shader error... [Re: Seriff] #59750
12/11/05 01:01
12/11/05 01:01
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
You must show us the code you are using.. the material must be setting a D3D renderstate that is changing blending modes or somehting..


Sphere Engine--the premier A6 graphics plugin.
Re: water reflection shader error... [Re: Matt_Aufderheide] #59751
12/14/05 08:20
12/14/05 08:20
Joined: Oct 2003
Posts: 702
Z
zazang Offline OP
User
zazang  Offline OP
User
Z

Joined: Oct 2003
Posts: 702
Hi Matt

Here is the code in the FX file : -

Code:
  float4x4 matWorldViewProj: register(c0);
float4 matWorld;
float4 vecViewPos;

texture entSkin1;
texture entSkin2;
texture entSkin3;

vector vecSkill41;

float1 mtlSkill1;

sampler BumpMap = sampler_state
{
texture=(entSkin3);
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = WRAP;
AddressV = WRAP;
};

sampler ReflectionMap = sampler_state
{
texture=(entSkin1);
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
};

struct VS_OUTPUT
{
float4 Pos: POSITION;
float2 texCoord: TEXCOORD0;
float3 eyeLinear: TEXCOORD1;
float4 fresnel: COLOR0;
};

VS_OUTPUT VS_p0(float4 Pos: POSITION)
{
VS_OUTPUT Out;

float4 pos = float4(1 * Pos.x, 1 * Pos.y - 1, 1 * Pos.z, 1);
float4 pPos = mul(float4(pos.xyz,1), matWorldViewProj);

Out.Pos = pPos;

Out.texCoord.x = Pos.x * 0.5;
Out.texCoord.y = Pos.z * 0.5;

Out.eyeLinear.x = 0.5 * (pPos.z + pPos.x);
Out.eyeLinear.y = 0.5 * (pPos.z - pPos.y);
Out.eyeLinear.z = pPos.z * 1;

float3 PositionWorld = mul(Pos, matWorld);
float dist=distance(PositionWorld, vecViewPos);

if (dist<=300)
{
Out.fresnel.xyzw=dist*0.005;
}

if (dist>300)
{
Out.fresnel.xyzw=1.0;
}


return Out;
}


float4 PS_p0( float2 texCoord: TEXCOORD0,float3 eyeLinear: TEXCOORD1, float4 fresnel: COLOR0) : COLOR
{

// addiere die Geschindigkeit von vecSkill41 hinzu für Wellenbewegung
float2 waterCoord = texCoord.xy * 0.001 * vecSkill41;

// die Bumpmap mit der waterCoord Koordinaten
float4 bump = tex2D(BumpMap, waterCoord) * 2 - 1;
bump = normalize(bump);

float2 mid = eyeLinear.xy / eyeLinear.z + bump.xy * 0.1f;

// Reflektierte Wasseroberfläche
float4 reflection = tex2D(ReflectionMap, mid);

float4 final=reflection;


float3 watercolor=(0.1,0.1,0.9); //adjust this change water coloring
final.rgb*=watercolor;
//final.w=(1*fresnel)*2;//0.8;



// Output
//return reflection;
return final;
}
technique water
{
pass p1
{
zwriteenable=false;
zenable=true;
alphablendenable=true;

VertexShader = compile vs_1_1 VS_p0();
PixelShader = compile ps_2_0 PS_p0();

}
}




Here is the WDL code : -

Code:
 

var bumpness = 2;
var speed = 0.6;

bind <water.fx>;

entity* water_ent;

var temp2[3];

var hoch;
var hoch1 = 3.2;

VIEW mirror
{
layer = 10;
}

function render_event();

MATERIAL waterfx
{
}

var hoch;
var hoch1 = 3.2;

ACTION water
{
water_ent = me;
var count;
var count1;
var a = 180;
var b;
my.transparent = on;
my.nofog = on;
my.material = waterfx;
//my.scale_x = 5;
//my.scale_y = 5;
//my.z += 20;
hoch = my.z;
while(1)
{
my.z = hoch;
my.skill41=float(count);
my.skill42=float(count1);
my.skill43=float(0);
my.skill44=float(0);
a += speed*time;
a %= 360;
b += speed*time;
b %= 360;
count = sin(a)+bumpness;
count1 = cos(b)+bumpness;
hoch1 = my.z*0.049;
wait(1);
}
}

STARTER init_water
{
wait(2);

while(water_ent==null){wait(1);}

mirror.size_x = camera.size_x;
mirror.size_y = camera.size_y;

camera.clip_near = 0;
mirror.clip_near = 0;
mirror.clip_far = 10000;
mirror.nocull = on;

mirror.bmap = bmap_for_entity(water_ent,1);
mirror.aspect = -1;
mirror.visible = on;


IF(d3d_shaderversion < 2020)
{
while(1)
{
draw_text("You need a video card with Pixelshader 2.0",screen_size.x-520,screen_size.y-280,vector(0,0,0));
wait(1);
}
}

loadfx();
mirror.aspect = -1;


while(1)
{
proc_late();
mirror.x = camera.x;
mirror.y = camera.y;
mirror.z = -camera.z+ (2*water_ent.z);
mirror.pan = camera.pan;
mirror.tilt = -camera.tilt;
wait(1);
}
}

FUNCTION loadfx
{
effect_load(waterfx,"water.fx");
}




Best regards
zazang


Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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