|
Entity Rendering Order/Priority
#226939
09/12/08 01:52
09/12/08 01:52
|
Joined: Feb 2002
Posts: 357 Florida
Zelek
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2002
Posts: 357
Florida
|
I have several sprite entities that exist in the same plane in 3d space. Example:
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: TechMuc]
#227144
09/12/08 20:35
09/12/08 20:35
|
Joined: Feb 2002
Posts: 357 Florida
Zelek
OP
Senior Member
|
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:
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]
#228232
09/18/08 09:53
09/18/08 09:53
|
Joined: Oct 2003
Posts: 702
zazang
User
|
User
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..
|
|
|
|