Separate model, sprite and tilemap Z order (SOLVED)

I’m using Rendercam. The render order appears to be:

  1. Sprites and tilemaps
  2. Models

Would it be possible to change this to:

  1. Sprites
  2. Models
  3. Tilemaps

I’ve tried to mess around with rendercam.render_script, but haven’t been able to achieve this.

If you open each material you see that each of them have a tag. Sprites and tilemaps have “tile” while models have “model”.

In the render script there’s multiple calls to render.draw() and each has a different predicate. A predicate matches a tag. If you want to separate the sprites and tilemaps you need to modify the material of one of them and assign a new tag and match that with a call to render.draw().

2 Likes

Nice, thanks!

Edit: This works really well, so easy!

Follow up question; I’d like the player model to show above all other models (without having to move it in z space). I created a new model material that I draw above the normal model material, but this doesn’t seem to make a difference. Is that because objects with z depth have to be drawn on the same “plane”? Weird question.

I think that models use the z-buffer. So also if you use a different predicate (and draw it later), the rendering checks the z-buffer before writing.

Probably the simple solution is just to offset the player model in the Z direction.

Yeah, that’s what I ended up doing. Thanks!