Camera default group

edited November 2014 in Help request
Hi there, I wonder if anyone could confirm or deny the results of some of my tests:

I tried setting the group list of the camera to:
GroupList = g1 # g2 # ... # g16

Doing so made every object of the scene disappear (none had a GroupId property set). I listed all the group ids and one object group id, they were all different.


So I Changed it to:
GroupList = g1 # g2 # ... # g15 # default
Then all the objects were drawn again.

My questions are:
1) Does that mean that orx "internally" support 17 groups?
2) Is it possible to set a group as "default" group without calling it "default"?

Comments

  • edited November 2014
    The "default" group always exists. It's the fallback if one doesn't explicitly define a Group for an object or a GroupList for a camera.
    In my current games, I don't have anything in that group at all, no objects, no cameras.

    You can't rename it, it has nothing special beside being the fallback. You can retrieve its ID by calling orxObject_GetDefaultGroupID(), this way no need to know that its actual name is "default".

    Now, and its really only a matter of preference, I would keep the group number as low as possible and give them meaningful names. Their goal is really to help organize objects to allow for easy compositing, picking and post-processing. In Little Cells, for example, I have:

    Background # Game # Glass # Light # Shadow # UI # UIThrough # Overlay

    A first viewport renders objects from Background + Game + Glass + Light to two separate textures: it's using Multiple Render Target (MRT) to get the color info to a back texture and shadow casters to an occluder texture.

    A second viewport computes shadow distances based on the occluder texture and the position of the lights to an intermediate per-light shadow texture. No camera/object rendering here.

    A third viewport renders actual pixel perfect projected shadows to a shadow texture. It also renders objects from the Shadow group on top of it (they are multiply-blended masks to simulate the lense framing).

    A forth viewport renders the groups UI + UIThrough + Overlay to a front texture. The UIThrough is where I put UI elements I don't want to be part of picking.

    A fifth and last viewport uses a shader to compose the final rendering based on the back, front and projected shadow textures (no camera/object rendering).
  • edited November 2014
    Oh, good to know.

    I am asking because I am trying to design the editor UI for the groups. So I was confused on the maximum number of groups that I could allow and how to handle the default group.

    I am considering adding a "limitation" on it and make the Default group be read-only, so the user would always have the default group (it would still be able to edit its priority) and 15 custom groups (those would be editable).
  • edited November 2014
    Yes, having the default group as read only is a good idea.
    As for the other groups, would it be hard to have a variable number?
    It starts with only a single group (default), then users can simply add/remove them at will as in the ends they're just literal tags.
  • edited November 2014
    That is pretty much what I am doing (still coding, I will post a screenshot when the UI is done). The limitation is that you can't have 16 custom groups (only 15), because you can't delete the default group.

    I think it is a very small limitation and will make the editor use much more intuitive.
  • edited November 2014
    I meant more something along the lines of why is there a limitation at all actually?
  • edited November 2014
    Using orx ini system you could have 16 custom named games, overriding the default group.

    With the editor, you can't do that, default group will always be in the priority list, hence you can only add 15 custom groups.

    Again, a very small limitation, since I would think very few people would have a real world use for the default group override.

    As promissed, here is the screen shot of the UI to add groups. It is fully functional. I will need another of those popups to edit the layer of the objects and to rewrite the rendering order of the objects of the scene, then Layer Module will be good to go. layers.png
    layers 24.6K
Sign In or Register to comment.