FlipY3D issue if setDesignResolution and RenderTexture is used

Hi there,

I am using a NodeGrid to flip the screen.
The NodeGrid visit is called between RenderTexture-> bebginClear() and end():

mRTex->beginWithClear(0, 0, 0, 255);
mNodeGrid->visit(renderer, transform, flags);

This works fine unless in AppDelegate the designResolutionSize was set. If I set the designResolutionSize, the rendered NodeGrid is scaled up ( I guess to match the glView->getFrameSize()

glview = GLViewImpl::createWithRect("xyz", cocos2d::Rect(0, 0, 1920, 1080));
glview->setDesignResolutionSize(1280, 720, ResolutionPolicy::SHOW_ALL);

In that case the nodegrid layer is scaled by factor 1.5 (1080/720) automatically as soon as the FlipY3D action is executed.

If designResolutionSize is equal to the windows size (1920,1080), everything is fine.

I have no clue how to solve that issue. Can also share the complete code if someone wants to have a look. @stevetranby Maybe you have a hint? You often solved such transformation issues in the past.


I have created a small test project to reproduce the issue.

NodeGrid_RenderTexture_DesignResolution_Issue.zip (46.4 KB)

@zhangxm can you please help here?
Thank you!

I think this is sort of just how the engine works? You’re sort of supposed to set the design resolution size to equal the window. Since this is a mobile-first engine the “Window” is just the screen device resolution (iOS/Android).

Are you literally only using NodeGrid to flip the screen? There’s got to be a better way to do that, most obviously by setting up your game world using whatever coordinates would have the sprites/objects upright without requiring flipping?

Anyway, I haven’t really used the 3D parts of the engine much.

If I find some free time I’ll try to look at the .zip test project, but I’m also not entirely sure what your desired result is? Does the NodeGrid layer look normal as desired until FlipY3D is run? Or is everything wrong (e.g. scaled 1.5) as soon as the scene is visible?

If my questions don’t make sense then it’s also just possible I’ve never tried to use these parts of the engine in the way you’re trying to use them?

  1. why are you trying to use RenderTexture? Maybe just add the objects to the scene directly?
  2. Why are you trying to use NodeGrid? Maybe just use 3D objects directly without it and flip the Y coordinates on create/initialize.
  • I’m not saying you shouldn’t / can’t use RenderTexture or NodeGrid, but your question is somewhat ambiguous or maybe not specific enough? at least for myself to offer advice, maybe someone else will chime in here?

Oh, also are you using latest v4.0 or v3.17?