Mobile model rendering (SOLVED)

I have game object with camera and sphere model.


Custom fragment shader paints model to solid color. Everything works as expected on desktop/web/mobile when game object have zero y position.

But when I move game object up (e.g y_pos = 100), model looks some strange (non sphere) on mobile (tested on android and ios)
.

Any ideas where can be mistake?
Test3d.zip (20.7 KB)

I’ve not tested your project yet. Does the mesh misbehave when you use the builtin model material too?

Your custom material misbehaves in the editor as well.

On my Android phone the mesh does not look deformed, but there are clearly issues with the material that are causing problem. You should work back from the builtin material vp and fp until it works right.

Here is a simple model test, may be helpful to you. Do the models in it display wrong on your phone? If so what’s the model of your phone and version?

3DModelTest.zip (169.7 KB)

2 Likes

Thank you for reply!

I change my material vp to builtin and now it works fine on android. But ios build have the same misbehave.
I’ll try builtin fp later.

Your example also works fine on android and have visual artefacts on ios:

My phone: iPhone SE (iPhone SE - Technical Specifications - Apple), ios v1.3

btw: how did you rotate your editor coordinate grid?

Could you try some different .dae models on your iPhone? If you search on github for .dae you can find lots of samples to test. On Windows, if you hold ctrl+leftclick you can rotate the viewport. Should be similar for macOS.

@andreas.strangequest did you see any issues with 3d models on iPhone with your materials or builtin materials?

Hi Pkeod. No, we havent but on the other hand we are using a flat shader without any lights or shadows which probably is the issue here with normals?

1 Like

I change material to /builtins/materials/model.material and make some tests for android (Asus Zenfone 5) and ios (iPhone SE) and different vertical positions for root game object (y = 0 and y = 100).

Android. y = 0 :ok_hand:

Android. y = 100 :ok_hand:

iOS. y = 0 :ok_hand:

iOS. y = 100 :persevere:

Render always works fine for direct sides (see cube model on right side). But I have no idea why :sweat:

Test3d.zip (177.0 KB)

Unfortunately I don’t have an iPhone SE so can’t test on that device. Will have to wait for Defold team member to comment, they probably have that device to test on and may know what’s going on.

@sven can hopefully take a look tomorrow at the office.

2 Likes

It might be due to floating point precision, could you try with this material instead;
highp_model_material.zip (1.3 KB)

3 Likes

Yes, with highp material model works as expected :fireworks:
Thanks everybody for help!

I like this forum :+1:

4 Likes