Tilemap wall layer vanishes at certain camera positions

See below image:

Anyone seen this kind of issue? I’m thinking it might have to do with the camera position and some kind of float/int conversion but I have no idea. It seems to hide tiles at random and at the top of the tilemap. I don’t see this issue at the bottom of the tilemap ever.

I tried flooring the camera position each update to avoid odd float values but this had no effect however.

Figured it out (for now.) I moved the camera Z position much higher and modified FOV/view distance settings of the rendercam to compensate for this. Now the issue no longer is showing up for me in the maps I created so far. I’ll have to see if it returns with larger maps in the future, but it seems to be related to the camera being too close to a tilemap.

It might be culling the tilemap chunks for whatever reason. You have depth testing enabled in your render script?

No I have this:

-- Sprite and particle rendering
	render.set_depth_mask(false)
	render.disable_state(render.STATE_DEPTH_TEST)
	render.disable_state(render.STATE_STENCIL_TEST)
	render.enable_state(render.STATE_BLEND)
	render.set_blend_func(render.BLEND_SRC_ALPHA, render.BLEND_ONE_MINUS_SRC_ALPHA)
	render.disable_state(render.STATE_CULL_FACE)

	render.draw(self.tile_pred)
	render.draw(self.particle_pred)

I tried messing with the depth state but instead of the tiles disappearing black corners show up on different tiles rather than them vanishing and it also messes up my HP bars for my enemies/causes other sprite issues.

You are going to want to have depth testing working if you are wanting your camera to be orientated in ways which cause these kind of problems, which means you will also need to change your render script to work with the blending.

If you are not using RenderCam yet try using it and see if it helps.

@Dragosha I know you have been working with mixed 3d and 2d recently. Could you share the render script parts that make the blending of sprites work? I’ve not messed with it recently enough to know it right away…

1 Like

But I didn’t mix regular tilemap and other components in my experiments.

1 Like

Thanks, I’ll definitely look into this soon. Right now I’m just placing columns in places where the issue doesn’t expose itself :blush: I need to get more content into the game and I experimented w/ using the depth shader for awhile but had to revert to an old commit because a lot of collision triggers stopped working after adjusting the location of hit boxes, sprites, etc. too rapidly. I’ll have to take a more cautious approach later and try again.