Start a new topic
Solved

3D model has transparent triangles (Native Android SDK)

Hello,


our company is considering Wikitude for development of several AR applications.


I've been trying the trial version to implement a sample Android app that renders 3D animated model attached to 2D AR target.


Since there is no support for rendering 3D models in native Android SDK I thought that I could use another library so that I don't have to write it all from scratch. I decided to use android-3D-model-viewer


I succesfully combined both libraries using custom external renderer. I'm able to import 3D models in .dae format and then render them with animations, textures and lighting in AR.


There is a single issue I haven't been able to solve. Some of the faces on the imported model seem to be transparent. See attached screenshot.


image


I thought that maybe they are just flipped so I tried to disable face culling but with no effect. I have not attached any texture and disabled lighting for simplicity. The issue seems to be related to the mesh itself. I am not very familliar with 3D rendering nor OpenGL so I decided to ask for help here.


If I try to replace the AR surface view with a simple one to render model in OpenGL and adjust the renderer accordingly, it works just fine. So I'm thinking that some of the settings of AR surface view or renderer in Wikitude SDK may be clashing with what I'm trying to do. See a screenshot below of the model rendered in simple OpenGL.


image


In the attachments you will find the source codes of a renderer and surface view both with and without AR.


You can find the cowboy model I'm using here.


I'll be very thankful for any suggestions as to what may be causing the issue.


Kind regards,


Adam

java
java
java
java

Hi Daniel,


I enabled GL_DEPTH_TEST right before the draw call as you suggested and it did the trick.


It seems like the calls to:


renderExtension.onUpdate();

renderExtension.onDrawFrame(unused);


are disabling depth test. 


I can't believe I didn't think of this before asking. Thank you for you help and have a nice day.


Adam

Hi Adam,



I can't imagine this being anything but the face culling. We might be changing the culling states in the SDK, which obviously might affect your renderings. Did you try to disable the culling right before your draw call?



- Daniel

Login or Signup to post a comment