Topic: [Suggestion] Background Object

I was browsing through the source code, and found a way to mess with the order in which things are rendered, but this seems out of my grasp:

would it be hard to make an object be rendered in between the background layers? maybe with a special "background_object" property, which would tell the engine that the object should be rendered in the same pass as the bg, and not the one where normally bricks and objects coexist.

before the question comes up, a zindex of 0 still renders the object over a bg layer.

usage scenario: dynamic clouds and weather, using alpha blended stuff on background, etc

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [Suggestion] Background Object

KZR wrote:

I was browsing through the source code, and found a way to mess with the order in which things are rendered, but this seems out of my grasp:

would it be hard to make an object be rendered in between the background layers? maybe with a special "background_object" property, which would tell the engine that the object should be rendered in the same pass as the bg, and not the one where normally bricks and objects coexist.

before the question comes up, a zindex of 0 still renders the object over a bg layer.

usage scenario: dynamic clouds and weather, using alpha blended stuff on background, etc

in your scenario, i think it's much easier to create objects that behave like dynamic clouds and so on... but let's examine the rendering system:

the pass is like this, in the code (see src/scenes/level.c):
1. render background => 2. render entities => 3. render water => 4. render foreground => 5. render hud
each bg entry having zindex <= 0.5 is rendered at first step
regular objects, with zindex <= 1 are rendered at second step
bg entries having zindex > 0.5 are rendered at step 4
objects width zindex > 1 are huds, being rendered at step 5

Re: [Suggestion] Background Object

Alexandre wrote:

each bg entry having zindex <= 0.5 is rendered at first step
regular objects, with zindex <= 1 are rendered at second step

my question is, how to render an object, for example, between two background layers? like this:

bg layer Z=0.3
object Z=0.4
bg layer Z=0.5

as of now, it looks impossible without changing the source code.

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [Suggestion] Background Object

The most logical thing would be to have a negative Z index to affect the bg. -0.1 - -1.

Re: [Suggestion] Background Object

hmm, not really possible without changing the source