I’m using v3.10 under Ubuntu 15.10 with the following specs:
gl.supports_BGRA8888: false
gl.supports_discard_framebuffer: false
gl.supports_NPOT: true
gl.supports_PVRTC: false
gl.supports_ATITC: false
cocos2d.x.version: cocos2d-x-3.10
gl.vendor: Intel Open Source Technology Center
cocos2d.x.compiled_with_gl_state_cache: true
gl.supports_S3TC: true
cocos2d.x.build_type: DEBUG
cocos2d.x.compiled_with_profiler: false
gl.renderer: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2)
gl.version: 3.0 Mesa 11.0.2
gl.supports_vertex_array_object: true
gl.max_texture_size: 8192
gl.max_texture_units: 96
gl.supports_ETC1: false
When I deploy the project to android it’s fine; smooth 60 fps, but it’s around 40 FPS on debug Linux build. Is it something that I do or something from cocos? It’ll start to behave that way after v3.8 I guess.
Do other games run at high FPS? What kind of hardware is it? 60fps should be pretty easy to hit with the cpp-tests project even when running inside a virtual machine, so …
cpp-tests is running 40 fps too.
I think it’s something caused by my system but I couldn’t figure it out what’s wrong.
@jjeorijjang - thanks for the solution.
Note that the defaults will behave differently.
//default context attributions are set as follows
// RGB: 565, Alpha:0, Depth:16-bits, Stencil: 0
GLContextAttrs GLView::_glContextAttrs = {5, 6, 5, 0, 16, 0};
I’m curious which of the changes helped improve your frame rate:
- No alpha possibly removing any blending required
- 16-bit depth instead of 24-bit due to certain device support
- No stencil which means no masking
I don’t know what is GLcontextAttrs mean…
i saw ExampleGame : Moon3D has 58FPS
so i just found different thing is GLcontextAttrs
i set it to {0, 0, 0, 0, 0, 8}
if i set stencil to 0, it give me some white screen(.tmx file or some cocosstudio asset)
so i set stencil to 8
now i have 58fps and all screen works well
tell me if u know something to edit with this setting
1 Like
Little update for this topic, I tried Kubuntu 15.10 yesterday -Ubuntu with KDE 5.4 desktop environment- and got smotth 60 FPS in KDE.
BTW I tried your GLContextAttrs solution bur no luck.