We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
RenderTexture issue 937 test doesn't work correct
RenderTexture issue 937 test doesn't work correct
- Project changed from cocos2d-x to cpp
- Target version set to 3.0-rc2
What about issue 4532 with RenderTexture?
I provided a fix in the bug report, and here:
http://www.cocos2d-x.org/forums/6/topics/45860?r=49478#message-49478
Basicaly,
_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.
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset commit:3a9cfefc02dbefa536f2228b94018441e6a6097b.
Looks like the problem was described incorrect in header post.
If you will change call order in test 937 like that:
addChild(spr_nonpremulti);
addChild(spr_premulti);
addChild(rend);
rend->begin();
spr_premulti->visit();
spr_nonpremulti->visit();
rend->end();
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.
Status: | Closed | |
---|---|---|
Start date: | 2014-04-07 | |
Priority: | High | |
Due date: | ||
Assignee: | zhangbin@cocos2d-x.org | |
% Done: | 100% |
|
Category: | all | |
Target version: | 3.0-rc2 |
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.