Obviously, in my projects I use (or at least would like to use) ZApplication.OnRender for drawing background of the whole application, AppState.OnRender to draw an overlay specific for given application state, Model.OnRender to render model's basic shape and ModelState.OnRender to render model state's specific overlay parts. So more specific OnRender section should add more specific rendering artifacts. Unfortunately, ZGE uses different rendering order, so for instance, when someone tries to render transparent model sprites on top of background rendered by ZApplication.OnRender, he obtains sprite squares where alpha channel is drawn with application's ClearColor, because models are rendered before ZApplication.OnRender. Therefore, it is necessary to render background as a Model. This is not so convenient.
I'm suggesting the following rendering order which for many cases is more logical:
1. ZApplication.OnRender
2. AppState.OnRender if it is active
3. Model.OnRender for each model instance depending on Model.RenderOrder
4. ModelState.OnRender if it is active
Because we do not want to corrupt backward compatibility, the best solution is to add the Application.RenderOrder property with a dropdown for choosing between "ModelsBeforeApp" or "AppBeforeModels", and the default is ModelsBeforeApp. This proposal has been discussed already with Ville who agrees, but we would like to know your opinion. Do you agree with the proposal?
Modifiable rendering order
Moderator: Moderators
Re: Modifiable rendering order
Sound logical, yes. And a drop down for choosing, so backwards compatibility is kept sounds like a good solution!
Re: Modifiable rendering order
Yes it makes sense, but please don't forget to keep the option to select the rendering order (I'm in the middle of a project that relies heavily on the current method.)
Re: Modifiable rendering order
Sure, all we have older and current projects; so backward compatibility is a must.
Re: Modifiable rendering order
I've implemented this feature now. Please download latest beta and give it a try.
Re: Modifiable rendering order
Great! Ville, thank you. I'll test it this evening.
Re: Modifiable rendering order
Tested it! Both modes seemed to work fine, though there were no difference for my project. I was thinking it might help with one of the rendering errors in the Android-version of my latest game, but it didn't help. Though I realize now that I misunderstood what this was supposed to do, so it wasn't strange nothing happened.