Projects > cpp > Issues > Bug #4703

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

RenderTexture issue 937 test doesn't work correct

Bug #4703 [Closed]
Fil1577 2014-04-07 14:57 . Updated over 2 years ago

If you will try to render some node into RenderTexture and then add it to the scene, it will be rendered to RenderTexture only.

Example in RenderTextureIssue937. Only left half of image is visible.

Tested on Samsung galaxy s3, gt-i9300, and PC.
Possible reason is that same command goes to render queue twice.

zhangxm 2014-04-08 08:48
  • Assignee set to
  • Priority changed from Low to High
Fil1577 2014-04-08 09:10

Bug localized:
_orderOfArrival variable drops to zero after single rendering.
It causes wrong rendering order in second rendering in the same quant. 2014-04-08 10:23
  • Project changed from cocos2d-x to cpp 2014-04-08 10:24
  • Target version set to 3.0-rc2
Romain 2014-04-08 23:22

What about issue 4532 with RenderTexture?
I provided a fix in the bug report, and here:

_fullRect and _fullviewPort definition have been switched in RenderTexture.cpp (check the .h description).
The effect is that the content of a RenderTexture is scaled (according to its size against the screen size), which is unexpected and different to previous versions of cocos2d-x.
The content scale should not vary based on RenderTexture size, and be identical to the content scale when drawing on screen (1 by default).

Sorry to insist on this.
And correct me if I'm wrong. 2014-04-09 07:38
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:3a9cfefc02dbefa536f2228b94018441e6a6097b.

Fil1577 2014-04-10 08:05

Looks like the problem was described incorrect in header post.

If you will change call order in test 937 like that:


left half of the image will be rendered behind the background, but it must be rendered in order of arrival of children (in front of the background).

It might became a problem when you need to do rendering to the render texture and scene at each quant (for example for rendering shadows). After rendering into the render texture operation, witch has high priority, order of arrival changes and rendering to the scene corrupts. So we need to change order of arrival manually, or rebild the scene (remove/add children) in each quant.

Atom PDF

Start date:2014-04-07
Due date:
% Done:


Target version:3.0-rc2

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.