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,699 guests, and 8 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
Page 1 of 3 1 2 3
nothing happend #281480
07/27/09 13:56
07/27/09 13:56
Joined: Jul 2009
Posts: 10
P
ProjectB Offline OP
Newbie
ProjectB  Offline OP
Newbie
P

Joined: Jul 2009
Posts: 10
I try different things with glas shaders.

My glas shader is:

Code:
float4 vecAmbient;
float4 vecDiffuse;
float4 vecSpecular;
float4 vecEmissive;
// transformations
float4x4 matWorld;
float4x4 matWorldViewProj;
float3 vecViewPos;

float4 vecFog;
float4 vecTime;



texture entSkin1;
texture entSkin2;
texture mtlSkin1;

samplerCUBE EnvironmentSampler = sampler_state
{ 
	Texture = <mtlSkin1>;
	MipFilter = LINEAR;
	MinFilter = LINEAR;
	MagFilter = LINEAR;
};

sampler ColorSampler =sampler_state
{
	Texture=<entSkin1>;
	
	MipFilter = LINEAR;
	MinFilter = LINEAR;
	MagFilter = LINEAR;
};

sampler NormalSampler =sampler_state
{
	Texture=<entSkin2>;
	
	MipFilter = LINEAR;
	MinFilter = LINEAR;
	MagFilter = LINEAR;
};






// vertex shader output structure
struct VS_OUTPUT
{
	float4 Pos  : POSITION;
	float2 Tex : TEXCOORD0;      
	float3 Eye : TEXCOORD1;
	float3 Norm: TEXCOORD2;
	float3 m1: TEXCOORD3;
	float3 m2: TEXCOORD4;
	float3 m3: TEXCOORD5;
	float  Fog:  FOG;
};


VS_OUTPUT VS(
float4 inPos  : POSITION,
float3 inNormal : NORMAL,
float2  inTex  : TEXCOORD0,
float3 inTangent : TEXCOORD2) 
{
	VS_OUTPUT Out = (VS_OUTPUT)0;
	float4 Pos = mul(inPos,matWorld);
	float3 Normal = normalize(mul(inNormal, (float3x3)matWorld));
	Out.Pos  = mul(inPos, matWorldViewProj);
	Out.Fog = 1 - (distance(Pos, vecViewPos) - vecFog.x) * vecFog.z;
	Out.Tex = inTex;	
	Out.Eye=Pos - vecViewPos;
	Out.Norm=Normal;
	float3x3 matTangent;
	matTangent[0] = mul(inTangent,matWorld);
	matTangent[1] = mul(cross(inTangent,inNormal),matWorld);	// binormal
	matTangent[2] = mul(inNormal,matWorld);
	Out.m1=matTangent[0];
	Out.m2=matTangent[1];
	Out.m3=matTangent[2];
	return Out;
}

float4 PS ( VS_OUTPUT In) : COLOR
{
	float4 OutColor;
	float4 color = tex2D(ColorSampler, In.Tex);
	float4 normal = tex2D(NormalSampler, In.Tex)*2-1;
	float3x3 toWorld;
	toWorld[0]=In.m1;
	toWorld[1]=In.m2;
	toWorld[2]=In.m3;
	float3 norm=mul(normal.xyz,toWorld);
	float3 vec = reflect(normalize(In.Eye), norm);
	float4 Environment = texCUBE(EnvironmentSampler,vec);	
	float3 vec2 = refract(normalize(In.Eye), norm, 0.95);
	float3 vec3 = refract(normalize(In.Eye), norm, 0.9525);
	float3 vec4 = refract(normalize(In.Eye), norm, 0.955);
	float4 EnvRefract = float4(texCUBE(EnvironmentSampler,vec2).r,texCUBE(EnvironmentSampler,vec3).g,texCUBE(EnvironmentSampler,vec4).b,1);
	float fresnel = 1-(dot(norm,-normalize(In.Eye)));
	fresnel=pow(fresnel,1.5);
	OutColor.rgb=lerp(color.rgb,EnvRefract,color.a)+Environment.rgb*1*fresnel;
	OutColor.a=(1-color.a)+pow(fresnel,0.25);
	return OutColor;
}

float4 PS_back( VS_OUTPUT In) : COLOR
{
	float4 OutColor;
	float4 color = tex2D(ColorSampler, In.Tex);
	float3 norm=In.Norm;
	float3 vec = reflect(normalize(In.Eye), norm);
	float4 Environment = texCUBE(EnvironmentSampler,vec);	
	float fresnel = 1-abs(dot(norm,-normalize(In.Eye)));
	fresnel=0.4+pow(fresnel,1.5);
	OutColor.rgb=vecAmbient.rgb*Environment.rgb*1*fresnel;
	OutColor.a=(1-color.a);
	return OutColor;
}



technique glas
{
	pass P0
	{
		CullMode=cw;
		Zenable=true;
		ZWriteEnable=true;
		VertexShader = compile vs_2_0 VS();
		PixelShader  = compile ps_2_0 PS_back();
	}
	pass P1
	{
		CullMode=ccw;
		Zenable=true;
		ZWriteEnable=true;
		VertexShader = compile vs_2_0 VS();
		PixelShader  = compile ps_2_0 PS();
	}
}





Now i try two methods to use this shader on an object in WED.


method 1:

Code:
material glas
{
	effect = "glas.fx";
}

action shader1  //wird im WED dem Modell zugewiesen
{
	my.material = glas;
}



And then I use this material on an simpel block in WED.


method 2:

Code:
bmap bmp_cubemap=<eigenx.bmp>;
material mat_earth
{
	effect="earth_glas.fx";
	skin1=bmp_cubemap;
	flags=TRANSLUCENT;
	ambient_red=200;
	ambient_green=180;
	ambient_blue=150;	
}

action earth
{
	my.material=mat_earth;	
	bmap_to_cubemap(bmp_cubemap);
}



And then I use this material on an simpel block in WED.



In both situiation nothing happend with the block, when i compile the scene.
What i doing wrong.
Can you help me?
Thanks.

Re: nothing happend [Re: ProjectB] #281493
07/27/09 14:19
07/27/09 14:19
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Which Version of A7 do you have?

Re: nothing happend [Re: Rei_Ayanami] #281495
07/27/09 14:25
07/27/09 14:25
Joined: Jul 2009
Posts: 10
P
ProjectB Offline OP
Newbie
ProjectB  Offline OP
Newbie
P

Joined: Jul 2009
Posts: 10
A7 Pro

Re: nothing happend [Re: ProjectB] #281498
07/27/09 14:31
07/27/09 14:31
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
version number?


3333333333
Re: nothing happend [Re: Quad] #281501
07/27/09 14:40
07/27/09 14:40
Joined: Jul 2009
Posts: 10
P
ProjectB Offline OP
Newbie
ProjectB  Offline OP
Newbie
P

Joined: Jul 2009
Posts: 10
Gamestudio A7 Pro 7.06
WED V6.8291

Re: nothing happend [Re: Quad] #281509
07/27/09 15:06
07/27/09 15:06
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
Originally Posted By: Quadraxas
version number?

what does version number have to do with it, unless your one of these "detectives" who likes to ask everyone with pro trying to find if they have warez or not.

people do own pro.

and version number past a7, and comm+ should all run shaders just fine.

Re: nothing happend [Re: lostclimate] #281530
07/27/09 16:15
07/27/09 16:15
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
As far as I know, is A7 Pro 7.06 are known Warez Versoin wink

Re: nothing happend [Re: Rei_Ayanami] #281545
07/27/09 17:08
07/27/09 17:08
Joined: Jul 2009
Posts: 10
P
ProjectB Offline OP
Newbie
ProjectB  Offline OP
Newbie
P

Joined: Jul 2009
Posts: 10
How could you know that? I dont know such things.

I thought I get help here. Okay, then I have to search again.

Re: nothing happend [Re: Rei_Ayanami] #281552
07/27/09 17:29
07/27/09 17:29
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Originally Posted By: Rei_Ayanami
As far as I know, is A7 Pro 7.06 are known Warez Versoin wink
You're right. It's a patch to change the version number.

Re: nothing happend [Re: Cowabanga] #281554
07/27/09 17:40
07/27/09 17:40
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
What do you mean to change the Version number ?

Btw: I was faster than you laugh!

Page 1 of 3 1 2 3

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