Jump to content

Problems on ObjectDynamic


photo

Recommended Posts

Posted

Could ObjectDynamic or Ffp do similar job like glDrawArraysInstanced?

Posted

Thank you, silent. we are going to research the function renderInstancedSurfac. But first, we need to upgrade to the latest Unigine.

Posted

Unigine had been updaded to the latest version!

Is there any demos on how to use renderInstancedSurfac?

Posted

There is no exact sample available with renderInstancedSurface() usage, but for ObjectMeshDynamic usage you can check:

  • Samples -> C++ API -> Nodes -> Objects
  • Samples -> UnigineScript -> Objects -> dynamic_**
  • Samples -> UnigineScript -> Shaders -> lines_00

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

Hi, silent:
According to the demos on ObjectDynamic, we invoke render() or  renderInstancedSurface() of MeshDynamic  in the update() or Render, but nothing displayed.

Should we set the MeshDynamic into Object so that it will display? But there is no interface we can do it.

So how to use MeshDynamic?

Posted

Hello liu.yan,

There's no need to call render explicitly. Once ObjectDynamic has proper mesh, settings and material, it will be rendered by engine like any other object. Inctancing also will be done automatically when ObjectDynamics point to the same mesh and have the same material.

I attached an example where several ObjectDynamics rendered instanced because there are cloned (so they have the same mesh) and have same material.

meshes.png

ObjectDynamicInstanced.zip

  • 2 weeks later...
Posted

Hi, Andrey:
  I had followed your way and it works. But the performance is dramatically dropping, comparing with ObjectMeshCluster.
 Is it normal or is there something we can do to improve performance.

 

test_cluster_9.png

test_9.png

test_100.png

Posted

Image descriptions(from top):
1 Render 9,000 cubes using ObjectMeshCluster
2 Render 9,000 cubes using new method
3 Render 1,000,000 cubes using new mothod

Posted

Hello liu.yan,

Instancing is not the only optimization used by ObjectMeshCluster. It also hugely reduces CPU-side bottlenecks by using effective data structures.

And for ObjectDynamic 1,000,000 nodes are still 1,000,000 nodes even with instancing. The engine can't really deal with such a number of them on the screen.

I can see two options here. The first one is to stick with ObjectMeshCluster and try to utilize the standard vertex format. And the second one is to write custom Object efficiently working with large number of MeshDynamic's instances which maybe not a simple task.

×
×
  • Create New...