Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Entity Rendering Order/Priority #226939
09/12/08 01:52
09/12/08 01:52
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I have several sprite entities that exist in the same plane in 3d space. Example:
Code:
ent_create("player1.png", vector(2,4,0), NULL);
ent_create("player2.png", vector(3,1,0), NULL);

Is there some way I can set the priority of which entity should be rendered in front without altering the Z-value? I basically need the functionality of the layer flag except for entities.

Re: Entity Rendering Order/Priority [Re: Zelek] #226985
09/12/08 09:51
09/12/08 09:51
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
ent->emask |= ZNEAR; sets an ent to the top of the rendering order

Re: Entity Rendering Order/Priority [Re: TechMuc] #227144
09/12/08 20:35
09/12/08 20:35
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I don't think that will work in this case, because I could have more than two entities that I need to sort. So assuming a case with 3, I need to have a way to say "render this one, THEN this one, THEN this one".

I'm not entirely opposed to using the z-coordinate for this sorting, but the problem is that I am using transparent sprites and the engine seems to get confused unless the difference in z-coordinates between entities is at least 3 pixels. I need it to correctly render these three entities:
Code:
ent_create("player1.png", vector(0,0,0.1), NULL);
ent_create("player2.png", vector(0,0,0.2), NULL);
ent_create("player3.png", vector(0,0,0.3), NULL);


Any help is very much appreciated.

Re: Entity Rendering Order/Priority [Re: Zelek] #228175
09/18/08 02:58
09/18/08 02:58
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
Anyone have any thoughts on the best way to approach this? I can give more clarification if needed.

Re: Entity Rendering Order/Priority [Re: Zelek] #228232
09/18/08 09:53
09/18/08 09:53
Joined: Oct 2003
Posts: 702
Z
zazang Offline
User
zazang  Offline
User
Z

Joined: Oct 2003
Posts: 702
It seems like the problem I faced when I was trying to make a 2d sidescroller...If you aren't opposed to using z coordinates,then try
also adding an alpha material..meaning this material to your sprites :-

material mat_alphatest
{
effect =
"
technique alpha_test
{
pass p0
{
zWriteEnable = true;
alphaTestEnable = true;
}
}
";
}

regards
zazang


I like good 'views' because they have no 'strings' attached..

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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