Sprite3d botched rendering

Sprite3d botched rendering

Hi all,

I’m having a Sprite3d rendering issue on Nexus 7 (1st gen) on Lollipop. The model is a single mesh with 11 bones.

It seems that the order some triangles are drawn is affecting the final result. Maybe a z-buffer issue?

No problems on Win32 and Moto G. Animations seem to be working correctly.

Thank you.


The problem seems to be that inside the cocos2dEGLConfigChooser class, the suggested OpenGL config is failing and instead OpenGL is initialized with a much more basic config that has the depth buffer set to 0 bits! The issue on the Nexus 7 is with the stencil buffer depth, which I do not need; I will set that to 0 bits instead.

Edit 2

Seems that Tegra 3 devices have a 16-bit depth buffer, so the default configuration will always fail.

Can you create a issue here

@nite, issue opened here

Thanks a lot

I run cocos2d-x v3.4 cpp-tests projects on Nexus7 2012 Android 4.2.2.

This problem is not solved by just setting depth bit from 24 to 16.

Please try these steps below.

Cpp file and method to edit:
AppDelegate.cpp - void AppDelegate::initGLContextAttrs()

Test Menu:
cpp-test - Node: Sprite3D - Use Case For 2D + 3D

At first, set below.
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};

This causes depthBits:0 and 3D rendering is botched.

At second, set below
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 16, 8};

This looks as if the problem is solved, but it’s not solved!
You can find Sprite3d is still botched by checking Use Case For 2D + 3D Menu.

Maybe devices which have NVIDIA Tegra chip cause this problem.
Many tablets have this chip, so I want to fix this.

Does Anyone know how to fix this problem?

1 Like

I’m also experiencing issues with Sprite3D on my Nexus 7. Did anyone find how to fix it?