We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Strange behavior with CCRenderTexture, setVertexZ, and Depth Buffers.
Strange behavior with CCRenderTexture, setVertexZ, and Depth Buffers.
Bug #4605 [Closed]
Redmine issue system is closed, we are using github issue system instead.
This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8390
Status: | Closed | |
---|---|---|
Start date: | 2014-03-30 | |
Priority: | Low | |
Due date: | ||
Assignee: | - | |
% Done: | 0% |
|
Category: | all | |
Target version: | - |
I've witnessed a strange behavior using CCRenderTexture that I'm wondering if its a bug or I'm missing something.
I have a whole bunch of batch nodes with sprites using setVertexZ for ordering. All the Z values fall between -1000 and 0. When the batch nodes are attached as children to a CCScene, everything works as expected, things are on top of other things and the sprites alphas are working as well. (See attached A)
Now, when I put those children on a CCRenderTexture with depth buffers, Things get a little strange. Its almost like its using the depth buffer backwards. (See attached B)
I've traced it down to this line in CCRenderTexture::begin():
I don't see the expected behavior with my scene until I swap the near and far parameters:
Once I do that, everything renders perfectly on the CCRenderTexture.
Am I missing something or is this a legitimate bug?
Screen Shot 2014-03-28 at 2.11.42 PM.png (27 kB) rcbuse, 2014-03-30 03:11
Screen Shot 2014-03-28 at 2.15.49 PM.png (21.7 kB) rcbuse, 2014-03-30 03:11