loopier / animatron-godot3

Yet another implementation of Animatron, but in Godot
GNU General Public License v3.0
17 stars 1 forks source link

Fix rendering order #11

Closed loopier closed 2 years ago

loopier commented 2 years ago

The current system of depth driven by y coordinate makes it impossible to set an image as background, because an image that is as big as the stage needs to be at he bottom, which is the same as being drawn last, so it conceals everything else.

A tested solution is to have an array with all the visible actor and element names, sorted by order of rendering. OSC messages can be used to reorder things in the array: /bg /fg /lower /rise.

This works for 2D, which is what I'm using now. I don't think I'll be using isometric for now. Maybe we should have different depth-calculation algorithms for different styles?

totalgee commented 2 years ago

Yes, we can go back to the non-sorting parent node. Or we can have a sorting option, or several "places" where you can add actors, like a background (actors aren't sorted), a regular 2D and an Ortho/spatial 2D.

For non-sorted, commands to move order are good. /shiftorder "om" -1

loopier commented 2 years ago

I'd try to keep it simple, with just one way to do it. If we are not going to use ortho, maybe we should not implement it yet, although I'm OK with keeping it in mind so we can escalate later if we need to incorporate it. Maybe leave room for it but without implementing it.

or several "places" where you can add actors, like a background (actors aren't sorted)

this sounds like a good idea, but it's an extra step to think about when using it, which leads me to think I won't think about it :) When I create an actor, I don't care about soring, I expect it to be at the top. If I explicitly need it to be lower, I would specify it. That's my workflow, or thinkflow, anyway. You might do things differently.

For non-sorted, commands to move order are good. /shiftorder "om" -1

In my last iteration I had a system which was a light version of your "places" idea. There was: /back, /backward, /forward and /front which is the standard in graphical UIs. These could be used to sort actors in a layer (which is just a group of actors). It could also be used to sort the layers.

There was also a /bg NAME which would set the actor as background. Only one could be set.

totalgee commented 2 years ago

Another option would be a behind/front command, which would ensure actor A is behind actor(s) B.

That way you could easily e.g. move something before a group, or all the om* actors, without needing to know the order beforehand.

Example 1: /behind bg * -- move bg before all other actors. Example 2: /front hat om -- move hat in front of om.

totalgee commented 2 years ago

Initial work: 5b74ebb

totalgee commented 2 years ago