Only Range [-1,0,1] Works With Z Order Of Objects?

Hi,

We are having an issue with the Z order of objects.
It seems the only Z order that works is in the range [-1,0,1]?

Please download the entire project on GitHub below:


If you run the demo, you will see the issue on the second title screen.
(the button texts are over the screen fading sprite)

Let us know how to fix this, thanks!

http://fallenangelsoftware.com/stuff/files/RedLightRacer/RedLightRacer.zip

P.S. - We are using the Linux version of Defold(if that matters).

J.

Yes, that is the projection that is set in the the default render script. You can change projection in a custom render script if you want to. But for most cases the best way is to keep things between -1 and 1. The numeric precision is very good in that range.

Hi,

I need a larger range, pehaps -10 to 10.
How would I implement the above into a custom render script?
(is there a tutorial somewhere on how to modify Z order range in a custom render script?)

Thanks!

J.

You do know that these are floating point values? You can have one object on 0 and one on 0.0001 and one on 0.0002 if you want, and even way more fine grained than that.

But if you really want to change the render script:

  1. Copy the built in render file and script to a location in your project.
  2. Alter the render file so it refers to your script copy.
  3. Set the bootstrap render file in game.project.

That’s it, now you can edit the render script. You need to change the near and far values if you want to change depth range.

2 Likes

Wait, the Z order values are floats?
Did not know that.
I should be fine now, thanks!

J.

1 Like

Yes. Pretty much all values are floats or have float components. Positions, colors, scales, rotations, durations, gains etc.

4 Likes