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
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ENABLE_RENDER question #205076
05/03/08 17:06
05/03/08 17:06
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline OP
Member
Fenriswolf  Offline OP
Member
F

Joined: Jan 2007
Posts: 221
Hello,

I am using a simple material effect that sets its emissive color according to the properties of the entity:

 Code:
vec_set(mtl.emissive_blue, my.blue);


This also requires to set ENABLE_RENDER to on.

The material works just fine as long as it is used by only one entity.
However, if it is used by more than one entity, then all those entities share the same emissive color, although their red/green/blue properties are different.

Shouldnt this work properly with ENABLE_RENDER?
 Quote:
ENABLE_RENDER
The material event is executed immediately before rendering the entity the material was assigned to.



Thanks

Re: ENABLE_RENDER question [Re: Fenriswolf] #205077
05/03/08 17:19
05/03/08 17:19
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
In my understanding it should work with ENABLE_RENDER. But I just had a look in the manual about that and it says this:
 Quote:

Die event-Funktion des Materials wird für sämtliche sichtbaren Entities kurz vor dem Rendern des Material-Effekts ausgeführt.

This could mean that the event function is only called once for all entities just before rendering. But I am not sure. Especially because the way it was used to be was quite usefull.

What you could do would be to create a copy of the material for each entity or using entSkill41-44.

Re: ENABLE_RENDER question [Re: Slin] #205085
05/03/08 18:31
05/03/08 18:31
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline OP
Member
Fenriswolf  Offline OP
Member
F

Joined: Jan 2007
Posts: 221
Thank you for your reply.
I was also confused by the different descriptions of ENABLE_RENDER in the english and the german manual:
The english version sais "the entity" while the german version sais "sämtliche...Entities/all...entities".

If I'm not mistaken entSkill41 respectivly vecSkill41 cant be used in material events?

Perhaps I should use a shader instead, as I need to shift the texture as well.

Re: ENABLE_RENDER question [Re: Fenriswolf] #205088
05/03/08 18:55
05/03/08 18:55
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Ahh sorry I somehow thought that you are using a shader ;\)
And I meant vecSkill41 and not entSkill41 which does not exist...^^

I would recomment you to create a new material for each entity then (mtl_create).
For texture shifting you can set entity.u/v which is now meant to be used again, with A7.07

Re: ENABLE_RENDER question [Re: Slin] #205104
05/04/08 00:32
05/04/08 00:32
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline OP
Member
Fenriswolf  Offline OP
Member
F

Joined: Jan 2007
Posts: 221
To be more specific about the shifting: I would like to shift the rgb texture and the alpha texture independently, so at least a FFE would be required for this.

Well, I'll use a shader then. In this case I probably would not need mtl_create.
Setting individual colors etc. in shaders worked fine for me up to now.


Thank you, Slin!:)


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