edited November 2014 in Help request
I don't know if what I've done is the correct method or not. I discovered that you can get layers by the order that you create objects. I mean, the first one is on top, second one is beneath it and so on. That seems pretty primitive because, then, how can you add an object at layer 2 later? I am sure I'm missing something here. Thanks in advance!


  • edited November 2014
    Heck, that can't be right. How could you place several objects at the same level?? Help!
  • edited November 2014
    You have to use the Group property.
    In the camera you set the GroupĹist, which will determine the order of the rendering (keep in mind that the last ones will be on top of the scene, since they are rendered over the first ones)
    GroupList = SceneBack # CharSprite # CharHair # CharHelm # CharArmor # default
    FrustumWidth = @Display.ScreenWidth
    FrustumHeight = @Display.ScreenHeight          
    FrustumFar = 2.0
    Zoom = 1.0

    And on the object you set Group property:
    Group = CharSprite
    Graphic = Character_Graphic_Start
    Position = (0, 0, 1.0)
    AnimationSet = CharacterAnimationSet
  • edited November 2014
    Thanks for the quick reply! I'll give that a go. I knew there had to be something like that. I've some more questions. I'll create more posts.
  • edited November 2014
    results: worked great!
  • edited November 2014
    I'll assume that you have looked at the Z order for your object positions first?

    so: (200, 200, -0.1) will be on top of (200, 200 0.0). That is the easiest way to sort out who is on top. Then, as Knolan says, you can use the GroupList for layering in addition.
  • edited November 2014
    Even if groups can be used for globally ordering the entire set of objects, it's not recommended, the Z coordinates gives a finer control and many more options for that.
    Note that groups do no intersect between each other, they are rendered separately. Within each group, the sorting is done based on the Z coordinate (and then batching occurs based on texture, filtering and shader, but that will never break the ordering).

    Groups are more intended to separate objects for easy compositing/post-processing as well as for handling hidden objects and debug rendering of those.
    For example, in most of my games I have a few groups that will render to a texture via a camera/viewport couple, then some compositing or post-processing will happen, then rendering of higher layers (UI/fade outs) will be done on top of that result and won't be affected by the aforementioned post-processing.
  • edited November 2014
    Ok, thanks. I was wondering about that. Haven't tested it yet. I was wondering if I'd still have collisions when grouping. But, I thought that the z position was reserved for 3d. I'm getting there.
  • edited November 2014
    Well, it didn't work. Doing something wrong I'm sure. I have 4 objects. My clock, a playing field and 2 players. The only thing I can get to show up now is the clock. It's the first one in the cfg file, other than the camera. I've tried several numbers for z but I can't get them to show up. I took out the grouping. Any ideas? About to leave for a while. I'll do some more troubleshooting when I get back.
  • edited November 2014
    Hey guys! Thanks! It's working now with z. Not sure what the problem was. Well, one of one was I left the grouplist in there. I deleted it. Anyway, it works. moving on to other things to pester you with...
Sign In or Register to comment.