Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (tomaslolo, bigsmack, AndrewAMD, TipmyPip), 903 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
effect_load? #21039
12/12/03 08:48
12/12/03 08:48
Joined: Aug 2003
Posts: 378
Marion,N.C. USA
Whisper Offline OP
Senior Member
Whisper  Offline OP
Senior Member

Joined: Aug 2003
Posts: 378
Marion,N.C. USA
has anyone been able to get
effect_load(mtl_mymat,"some.fx"); to work?

my attempts have failed, either i'm not calling it right or not putting it in the proper place in my effects.wdl.
any examples of it anywhere.

Re: effect_load? [Re: Whisper] #21040
12/12/03 10:36
12/12/03 10:36
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
i havent tried the load fx feature.. but i assume you will need to make some changes to the fx b4 you can use it.. at least you will need to set up the textures it uses.. also.. i think there diferences in some fx files.. Ive had to modify fx files to make them work.. post your code and maybe i can tell whats wrong


Sphere Engine--the premier A6 graphics plugin.
Re: effect_load? [Re: Matt_Aufderheide] #21041
12/12/03 11:09
12/12/03 11:09
Joined: Jul 2002
Posts: 2,813
U.S.
Nadester Offline

Expert
Nadester  Offline

Expert

Joined: Jul 2002
Posts: 2,813
U.S.
Also, you must make sure that the .fx file is DX 8.1 bases, or 8.0. This means Rendermonkey shaders arent compatable. I have not found to many .fx files around, so I havnt experimented much.


--Eric
Re: effect_load? [Re: Nadester] #21042
12/12/03 12:12
12/12/03 12:12
Joined: Aug 2003
Posts: 378
Marion,N.C. USA
Whisper Offline OP
Senior Member
Whisper  Offline OP
Senior Member

Joined: Aug 2003
Posts: 378
Marion,N.C. USA
//
// Simple Lighting Model
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//

string XFile = "tiger.x"; // model
int BCLR = 0xff202080; // background

// light direction (view space)
float3 lightDir < string UIDirectional = "Light Direction"; > = {0.577, -0.577, 0.577};

// light intensity
float4 I_a = { 0.1f, 0.1f, 0.1f, 1.0f }; // ambient
float4 I_d = { 1.0f, 1.0f, 1.0f, 1.0f }; // diffuse
float4 I_s = { 1.0f, 1.0f, 1.0f, 1.0f }; // specular

// material reflectivity
float4 k_a : MATERIALAMBIENT = { 1.0f, 1.0f, 1.0f, 1.0f }; // ambient
float4 k_d : MATERIALDIFFUSE = { 1.0f, 1.0f, 1.0f, 1.0f }; // diffuse
float4 k_s : MATERIALSPECULAR= { 1.0f, 1.0f, 1.0f, 1.0f }; // specular
float n : MATERIALPOWER = 32.0f; // power

// texture
texture Tex0 < string name = "tiger.bmp"; >;

// transformations
float4x4 World : WORLD;
float4x4 View : VIEW;
float4x4 Projection : PROJECTION;

struct VS_OUTPUT
{
float4 Pos : POSITION;
float4 Diff : COLOR0;
float4 Spec : COLOR1;
float2 Tex : TEXCOORD0;
};

VS_OUTPUT VS(
float3 Pos : POSITION,
float3 Norm : NORMAL,
float2 Tex : TEXCOORD0)
{
VS_OUTPUT Out = (VS_OUTPUT)0;

float3 L = -lightDir;

float4x4 WorldView = mul(World, View);

float3 P = mul(float4(Pos, 1), (float4x3)WorldView); // position (view space)
float3 N = normalize(mul(Norm, (float3x3)WorldView)); // normal (view space)

float3 R = normalize(2 * dot(N, L) * N - L); // reflection vector (view space)
float3 V = -normalize(P); // view direction (view space)

Out.Pos = mul(float4(P, 1), Projection); // position (projected)
Out.Diff = I_a * k_a + I_d * k_d * max(0, dot(N, L)); // diffuse + ambient
Out.Spec = I_s * k_s * pow(max(0, dot(R, V)), n/4); // specular
Out.Tex = Tex;

return Out;
}

sampler Sampler = sampler_state
{
Texture = (Tex0);
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
};

float4 PS(
float4 Diff : COLOR0,
float4 Spec : COLOR1,
float2 Tex : TEXCOORD0) : COLOR
{
return tex2D(Sampler, Tex) * Diff + Spec;
}

technique TNoShader
{
pass P0
{
// transforms
WorldTransform[0] = (World);
ViewTransform = (View);
ProjectionTransform = (Projection);

// material
MaterialAmbient = (k_a);
MaterialDiffuse = (k_d);
MaterialSpecular = (k_s);
MaterialPower = (n);

// lighting
LightType[0] = DIRECTIONAL;
LightAmbient[0] = (I_a);
LightDiffuse[0] = (I_d);
LightSpecular[0] = (I_s);
LightDirection[0] = (lightDir);
LightRange[0] = 100000.0f;

LightEnable[0] = TRUE;
Lighting = TRUE;
SpecularEnable = TRUE;

// samplers
Sampler[0] = (Sampler);

// texture stages
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
ColorArg2[0] = DIFFUSE;
AlphaOp[0] = MODULATE;
AlphaArg1[0] = TEXTURE;
AlphaArg2[0] = DIFFUSE;

ColorOp[1] = DISABLE;
AlphaOp[1] = DISABLE;

// shaders
VertexShader = NULL;
PixelShader = NULL;
}
}

technique TVertexShaderOnly
{
pass P0
{
// lighting
Lighting = FALSE;
SpecularEnable = TRUE;

// samplers
Sampler[0] = (Sampler);

// texture stages
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
ColorArg2[0] = DIFFUSE;
AlphaOp[0] = MODULATE;
AlphaArg1[0] = TEXTURE;
AlphaArg2[0] = DIFFUSE;

ColorOp[1] = DISABLE;
AlphaOp[1] = DISABLE;

// shaders
VertexShader = compile vs_1_1 VS();
PixelShader = NULL;
}
}

technique TVertexAndPixelShader
{
pass P0
{
// shaders
VertexShader = compile vs_1_1 VS();
PixelShader = compile ps_1_1 PS();
}
}

this is one of the codes from MS, been trying to use it, inorder to get things to work.

Re: effect_load? [Re: Whisper] #21043
12/12/03 14:58
12/12/03 14:58
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
I dont know where to begin...this fx wont work in its current form... you need to gut it completely...The matrix declarations need to be chnaged.. the model string needs to be gotten rid of.. and so on.. I suggest you take a closer look at the example files in the 6.2 release..


Sphere Engine--the premier A6 graphics plugin.
Re: effect_load? [Re: Matt_Aufderheide] #21044
12/13/03 06:34
12/13/03 06:34
Joined: Aug 2003
Posts: 378
Marion,N.C. USA
Whisper Offline OP
Senior Member
Whisper  Offline OP
Senior Member

Joined: Aug 2003
Posts: 378
Marion,N.C. USA
well i had already looked at the examples, so i went back and rewrote it,still get a couple of errors, but it works now, getting a great fog effect from it. rotating fog effect.

regards
whisper

Re: effect_load? [Re: Whisper] #21045
12/13/03 10:46
12/13/03 10:46
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
please share!


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: effect_load? [Re: Drew] #21046
12/14/03 11:55
12/14/03 11:55
Joined: Aug 2003
Posts: 378
Marion,N.C. USA
Whisper Offline OP
Senior Member
Whisper  Offline OP
Senior Member

Joined: Aug 2003
Posts: 378
Marion,N.C. USA
Quote:

please share!



as soon as i get my web site back up in about a week.
there will be and area for shader codes posted there.also
and area for those of use who need to learn how to convert,
fx files that will work with A6,hopes are to create an index of what names in a fx goes with A6.


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