Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
1 registered members (AndrewAMD), 1,225 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19056 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Possible bug with ent_mtlset #228923
09/23/08 14:24
09/23/08 14:24
Joined: Oct 2004
Posts: 150
Germany
T
tkunze Offline OP
Member
tkunze  Offline OP
Member
T

Joined: Oct 2004
Posts: 150
Germany
I wanted to apply a meterial using the ent_mtlset command and experienced the following strange behaviour.

The behaviour is the same in version 7.5 and 7.53 which i tested with the sample project below.

This is the code which produces the picture below:
Code:
action testblock1() {
	my.material = dm_brick01;
}

action testblock2() {
	ent_mtlset(my,dm_brick01,1);
}


With this code no shader seems to be effetive on both entities
Code:
action testblock1() {
	ent_mtlset(my,dm_brick01,1);
}

action testblock2() {
	ent_mtlset(my,dm_brick01,1);
}


With this code the shader works on both entities
Code:
action testblock1() {
	my.material = dm_brick01;
}

action testblock2() {
	my.material = dm_brick01;
}


Sample Project

Picture: Block on the left using ent_mtlset shows not the expected result, on the right with my.material everything works fine


Re: Possible bug with ent_mtlset [Re: tkunze] #228930
09/23/08 15:48
09/23/08 15:48
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I don't know what you want to do, but for applying a material, use the entity material parameter. Despite the "mtl" in the function name, ent_mtlset sets a skin material only, and won't affect the material of your entity.

http://manual.conitec.net/aent_mtlset.htm


Re: Possible bug with ent_mtlset [Re: jcl] #228939
09/23/08 16:48
09/23/08 16:48
Joined: Oct 2004
Posts: 150
Germany
T
tkunze Offline OP
Member
tkunze  Offline OP
Member
T

Joined: Oct 2004
Posts: 150
Germany
But in this case i would expect that ent_mtlset and my.material shows the same effect on an entity with just one skin.

What i want to achieve is the follwing.

I import a model with 6 materials to med which creates 6 skins.

I want to apply to each of this 6 skins the relief shader from slin.

Therefore i want to create 6 materials where each has the shader as effect
and the necessary additional images (normal map ...) as mtlskin.

Finally i intended to apply the different materials (stone, wood ...) in
the action to the different skins using mtl_entset.

This is more or less what i understood mtl_entset could be used for. With the entity material pointer i can only apply the same material to all skins which
does not fit my needs.

Picture: House Model in Unwrap3d with 6 Materials


Picture: House Model in another game engine with shaders applied as described


Picture: House Model in Gamestudio without shader











Last edited by tkunze; 09/23/08 17:36.
Re: Possible bug with ent_mtlset [Re: tkunze] #229047
09/24/08 06:51
09/24/08 06:51
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, then the problem seems clear - you were just confusing ent_mtlset with the material parameter. Again: ent_mtlset does NOT set an entity material. But when your effect requires a material, you must set it.

my.material = dm_brick01;

That's how to set a material.

Re: Possible bug with ent_mtlset [Re: jcl] #229057
09/24/08 09:39
09/24/08 09:39
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
That means that there is no way to assign different shaders to different parts of the model from within the code? I btw tried to assign some shaders directly to the skins in MED but it seems to mess up some things because of different numbers of skins needed per shader...

Re: Possible bug with ent_mtlset [Re: Slin] #229061
09/24/08 10:05
09/24/08 10:05
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
ent_mtlset is for assigning different shaders to different skins - but it assigns _only_ the shaders, _not_ the material.

For preventing misunderstandings, I've added a comment to the manual:

"This function does not set the entity material parameter. When the effect uses material skins or parameters, the material must be assigned to the entity. Material skins and parameters are shared by all skin effects."

http://manual.conitec.net/aent_mtlset.htm

Re: Possible bug with ent_mtlset [Re: jcl] #229145
09/24/08 19:52
09/24/08 19:52
Joined: Oct 2004
Posts: 150
Germany
T
tkunze Offline OP
Member
tkunze  Offline OP
Member
T

Joined: Oct 2004
Posts: 150
Germany
Just for clarification. This means if i need bump and heightmap i have to prepare my model as followed:

skin1 = texture (e.g. stone)
skin2 = bumpmap stone
skin3 = heightmap stone
skin4 = texture (e.g wood)
skin5 = bumpmap wood
skin6 = heightmap wood
...
(here the others)

Then i apply the shaders with:

ent_mtlset(my,<shader>,1) apply shader to stone
ent_mtlset(my,<shader>,4) apply shader to wood
...
apply shader to the other skins (e.g. roof ...)

in the shader i access the bumpmap and heightmap with entSkin2 and entSkin3.

Is this the intended approach for ent_mtlset?

Re: Possible bug with ent_mtlset [Re: tkunze] #229183
09/25/08 08:51
09/25/08 08:51
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
No. I don't understand why you'd want to use ent_mtlset when you only have a single shader. What you apparently want to do is applying an entity material - so just set it.


Moderated by  HeelX, Spirit 

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