The flip issue when using RenderTexture with the Metal backend renderer when has been logged here, and I really wish it would be addressed.
Now, regarding the text within the buttons on iOS, is it the text that’s shifted down, or the button is shifted up, it’s hard to tell from your screenshot, since it’s not the same scale as the Windows and Android screenshots.
Do you have a small demo project you can upload here as a zip? (without the binary build folder or cocos2d folder to reduce the size)
Have you checked the results of the calculations between the different platforms to see if there are any differences in the items rendered to the RenderTexture?
For the Android compared to Windows, I can see that the Android textures are a little bigger; is that what you’re referring to?
The RenderTexture result on iOS (Metal renderer) is different to the result from Windows/Android (OpenGL renderer). The expectation is that RenderTexture should produce the exact same output on all platforms.
The problem is that some space appear, this should be 6px but it’s only 5px but if you put this line at an other position in the scene screen or an other position in the RenderTexture the 6px may appear.
Here on this updated demo I added line, all line are the same SpriteFrame on the TextureRect but result is different as you can see
I am trying to use RenderTexture to reduce draw calls because I use a lot of DrawNode in my app with GlobalZOrder but if you guys know another way, I will appreciate.
Thank you but I have no FPS problem, only draw calls.
I made important optimization on my app with GlobalZOrder and for DrawNode I got the idea to put them into RenderTexture and I can’t use Sprite directly because some size are dynamically.
But may be I will abandon this solution which seems good to me at first sight to come back with higher draw calls
Is it okay to have 60 draw calls from DrawNode because with RenderTexture you have only 1 draw calls but I encountered two problems (iOS and offset) and my update still delayed until I find a solution ?
You can use a single DrawNode to do all the drawing, which would be a single draw call for as many objects as you want to draw with it on the screen. In your current implementation you’re creating a new DrawNode every time you create a shape, which is where you would run into performance problems.
I can’t remember if you can change the global Z per object drawn with the same DrawNode, but it’s something you should be able to test easily.
If you’re using it just for a UI, then is there any reason you can’t just clear everything and redraw each frame? In doing that, you can do whatever you want with the objects on the screen, even make them look like they’re animating (for example, button scaling when you press it etc.)