Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 4,296 guests, and 26 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Error while include mtlFX.c in main.c #146335
08/07/07 08:00
08/07/07 08:00
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline OP
Serious User
vlau  Offline OP
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
I've copied mtlFX.c to my work directory then
include this file in my main.c like this :

#include <acknex.h>
#include <default.c>
#include "mtlFX.c"

none actions assigned to any entity and when run,
I got this message :

Malfunction W1550
-----------------
Error in effect:
(23): error X3003: redifinition of 'matWorldView'

>float 4x4 matWorldView;<

What I'm doing wrong?

Re: Error while include mtlFX.c in main.c [Re: vlau] #146336
08/07/07 08:05
08/07/07 08:05
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Does it happen when you run the Shader test?


smile
Re: Error while include mtlFX.c in main.c [Re: D3D] #146337
08/07/07 08:11
08/07/07 08:11
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline OP
Serious User
vlau  Offline OP
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
It runs fine with the ShaderTest.c.
Any ideas?

Re: Error while include mtlFX.c in main.c [Re: vlau] #146338
08/07/07 08:12
08/07/07 08:12
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Try adding a wdl with the same name of the project in the same directory (is it called main.c? then it would be main.wdl) and put in these lines in the file:

PATH "%EXE_DIR%\\template_6\\code";
PATH "%EXE_DIR%\\template_6\\images";

Hmm I tried what would happen, but that doesn't help much.


smile
Re: Error while include mtlFX.c in main.c [Re: D3D] #146339
08/07/07 08:14
08/07/07 08:14
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline OP
Serious User
vlau  Offline OP
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Sorry, forget to mention that I've already added
these 2 lines in main.wdl also

PATH "%EXE_DIR%\\template_6\\code";
PATH "%EXE_DIR%\\template_6\\images";

but the error still exists.

EDIT
----
I'm even write it explicitly :

path "c:\\Program Files\\GStudio7\\template_6\\code";
path "c:\\Program Files\\GStudio7\\template_6\\images";

still no success.




Last edited by vlau; 08/07/07 08:19.
Re: Error while include mtlFX.c in main.c [Re: vlau] #146340
08/07/07 08:18
08/07/07 08:18
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
LOL I now get the same error in my project Are you trying to multitexture terrain?


smile
Re: Error while include mtlFX.c in main.c [Re: D3D] #146341
08/07/07 08:31
08/07/07 08:31
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
Yes, this is a bug in default.fx. It happens when you use <fog> and <view> at the same time in a shader.

Solution: Edit default.fx and replace

float4x4 matWorldView;

by:

#ifndef MATWORLDVIEW
float4x4 matWorldView;
#define MATWORLDVIEW
#endif

This ensures that matWorldView is only defined once.

Re: Error while include mtlFX.c in main.c [Re: jcl] #146342
08/07/07 08:43
08/07/07 08:43
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
You mean defined twice like this?

default.fx
Code:
//////////////////////////////////////////////////////////////////////
//section: fog ///////////////////////////////////////////////////////

float4 vecFog;
float4 vecViewPos;
//float4x4 matWorldView;
#ifndef MATWORLDVIEW
float4x4 matWorldView;
#define MATWORLDVIEW
#endif

#ifndef MATWORLD
float4x4 matWorld;
#define MATWORLD
#endif

#ifdef DXFOG
float DoFog(float4 Pos)
{
float3 P = mul(Pos,matWorldView); // convert vector to view space to get it's depth (.z)
return saturate((vecFog.y-P.z) * vecFog.z); // apply the linear fog formula
}
#else // distance based fog
float DoFog(float4 Pos)
{
float3 P = mul(Pos,matWorld);
return 1 - (distance(P,vecViewPos)-vecFog.x) * vecFog.z;
}
#endif

...

//////////////////////////////////////////////////////////////////////
//section: view - transform vertex position to view space ////////////

//float4x4 matWorldView;
#ifndef MATWORLDVIEW
float4x4 matWorldView;
#define MATWORLDVIEW
#endif

float4 DoView(float4 Pos)
{
return (mul(Pos,matWorldView));
}
float3 DoView(float3 Pos)
{
return (mul(Pos,matWorldView));
}




smile
Re: Error while include mtlFX.c in main.c [Re: D3D] #146343
08/07/07 09:13
08/07/07 09:13
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline OP
Serious User
vlau  Offline OP
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Thank you jcl, it works now.
Dusty, thank you for your time also.

Re: Error while include mtlFX.c in main.c [Re: vlau] #146344
08/13/07 19:21
08/13/07 19:21
Joined: Aug 2005
Posts: 512
Bayern
Schmerzmittel Offline
User
Schmerzmittel  Offline
User

Joined: Aug 2005
Posts: 512
Bayern
Also bei mir funktionierts noch immer nicht.

Ich habe die zwei Zeilen geänder, aber diesmal sagt er mir, das in Zeile 23 ein Fehler ist...

Code:
22: //section: sun - return the sun light on the surface /////////////////
23:
24: float4 vecSunDir;



Woran kann das liegen?


A7 Com V7.80
Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

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