cocos2d-x auto-culling or a bug?

I create a HelloWorld project with cocos2d-x 3.2 or 3.3. In HelloWorld.cpp there is a sprite. I activate depth buffers on Director like this:

Director::getInstance()->setDepthTest(true);

and set sprite Z position as follows:

sprite->setPositionZ(-200.0f);

The result is that the image moves right and up. Which is clear as I have a perspective projection. So when I set now the position to (-1, -1) and change anchor point to right-bottom:

    sprite->setPositionZ(-200.0f);
    sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_RIGHT);
    sprite->setPosition(Vec2(-1, -1));

the sprite should be visible, also because of the shift to up and right. But it doesn’t. It is being culled? How can I make it be rendered as it is in the frustum and it should be visible. Is this a bug or there is a flag to change this behavior?

P.S. I have tried with camera (ActionCamera) with moving it, and when the sprite is out of the scope but still in the frustum, it is not being rendered.

1 Like

Can you create an issue for this?

Although I think it shouldn’t be

So you think it is a bug?

It’s hard to tell if it’s still in the frustum, the default one is pretty small…

Maybe you can create a test-case that move the camera back and forth, and see if it’s actually been culled.

Is it? If I place right-bottom corner of the image on the 1, 1 and set z to -300 I see a lots of part of the image in the screen instead of just on pixel. But when I move the image only 2 pixels out of the screen, the image disappears. This test is not enough to be sure that the image is in the frustum when it has (-1, -1, -300) coordinates and when anchor point is right-bottom?

My game actually uses ActionCamera and it is really being culled. It is like there is a smaller (then the screen) rectangle in the center of the screen that culls all the sprites which are out of it. It is like the far clipping plane is smaller than the near one, which is strange and, I guess, not the case with cocos2d-x, right?

P.S. Here is the issue report https://github.com/cocos2d/cocos2d-x/issues/10275