[SOLVED] Sprite3D perfomance issue

[SOLVED] Sprite3D perfomance issue

At my game, I should display many absolutely same trees in different positions.
Drawing them I get too big Open GL Calls counter, so auto-batching doesn’t work here.
Following this recommendation I made trees model’s visit() function called in sequence by adding all of them to the same node, containing only trees, but it doesn’t help me (Open Gl Calls count haven’t decreased).

I create trees this way:

auto tree = Sprite3D::create("tree.obj");

Could someone help me to figure out, what the problem is?
Thanks in advance!

Did you try cpp-tests to see how it works there?

1 Like


Sorry, I am new to cocos2dx and have never run cpp-tests.
Following those instructions I have done
git submodule update --init and ./download-deps.py commands and ./intall-deps-linux.sh, trying to create linux-build folder here, but unsuccessfully as you can see from this picture.

By the way, ./intall-deps-linux.sh haven’t thrown any errors.

I am on Ubuntu 18, coding from Android Studio/CLion.

Use these: https://docs.cocos2d-x.org/cocos2d-x/v3/en/installation/Linux.html

Ok, I compared my code with Sprite3DWithOBBPerformanceTest and found out that the only difference is in the type of 3D model loading to Sprite3D. I checked this guess by changing my tree.obj model to a tortoise.c3b and auto-batching started working properly!

The only problem I am faced with right now is converting from popular formats, like obj, fbx and so on, to c3b on Ubunu 18.
Is there any way to do this without Cocos Creator, cause there isn’t any version for Ubuntu?

use our fbx-conv tool. I think it gets compiled for linux as part of the deps.


1 Like

I feel like fbx-conv doesn’t get compiled on linux as part of the deps, I haven’t managed to run it. But it is not really a big deal, I used this commad from my Windows computer.

Anyway, right now everything work properly, so thank you very much for your help, your answers were very helpful!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.