Replies: 2 comments 6 replies
-
@pandamicro Please look at this feedback. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure I fully understand your question. I assume you want that the renderer can automatically improve draw call batches by reordering nodes ? If that's the case then we currently don't have any automatic order optimization algorithm. The thing is there is always trade offs, if the renderer wants to optimize draw call, it has to know the relationship between nodes, whether they can be batched together, whether they overlaps each other, whether they need blend. All these calculations can be very complicated, for a general purpose reorder and batch algorithm from the renderer point of view. It can only be done in the CPU, with JavaScript implementation, it could be even worse than more draw calls. I'm not saying we shouldn't do any improvement, it's just easy to see benefits and miss the trade offs. I can share what we are gonna do in 3.x
|
Beta Was this translation helpful? Give feedback.
-
The optimization possibly needs to be done by adding or changing some features of the renderer module.
The Scene :
Labels are depth check enabled , modified shader to handle depth drawing correctly.
The hierarchy of the node-tree is not important , just the positions are enough for calling the draw function, But still creates multiple draw calls , for same type of nodes, which can be handled in 1 draw call.
When we place many nodes , which would be optimized , possible the old 2D renderer based algorithms take place , and checks for z-orders of the node.
this creates 2 draw calls , 1 for the labels (bitmap font) , 1 for the boxes (batched)
and this creates 5 draw calls , just changed the node hierarchy , same output , same nodes, same batching optimizations .
If there's a solution you found ( a workaround ) , let's talk about it. If not , this possibly will be a lightning performance improvement for Cocos (when z-orders of nodes do not trigger "sub draw finished", instead calling sub draw calls ,grouped to optimized batching , reagerdless of node-tree levels or z-indexes . ).
Beta Was this translation helpful? Give feedback.
All reactions