Introduction to New Renderer

Introduction to New Renderer

Overview

This article is mainly a overview of cocos2d v3.x rendering pipeline from a developer's view. It is not a substitution of the original roadmap provided by the core engine team.

Note: It will not cover most of the implementation details of the new rendering pipeline. If you want to contribute, please refer to the roadmap documentation.

At first, let's take a look at the vision of the new rendering pipeline.

The Vision

The cocos2d v3.x new rendering pipeline aims at improving the rendering performance by leveraging the modern multi-core CPUs so popular nowadays on most modern mobile devices.

At the meanwhile, the API style of cocos2d v3.x is compatible with the v2.x which the current cocos2d users will feel very comfortable with.

The Goal

The high level goal of the new features and improvement can be summarized as the following:

  • Decouple the scene graph from the renderer
  • Viewing frustum Geometry culling
  • Rendering on a separate thread
  • Automatic batching
  • (Node based) Customizable rendering
  • Optimized for 2D, but suitable for 3D as well

The Roadmap

Currently, since cocos2d v3.0beta, renderer has being decoupled from the Scene Graph and it also supports auto-batching and auto-culling.

The complete Roadmap of the rendering can be found here.

Overview of the new rendering architecture

As we mentioned above, the actual rendering API goes into a new separate thread where a RenderQueue has been provided to issue call OpenGL commands directly to the graphic card.

Here is the illustration picture:

architecture

The process of scene graph is running in a front-end thread while generating various Command. Each Command will be sent to the CommandQueue waited to be processed(such as sorting, rearrange etc.) in a separate back-end thread.

The internal format of each Command is out of scope in the documentation, please refer to the roadmap documentation.

If you want to extend cocos2d engine v3.x. For example, if you want to define a Sprite with some customize drawing code. You can't put them into the old draw() function any longer.

You should be familiar with the corresponding Command and construct the Command on demand in the draw() function.

For more information, you can take a look at DrawNode built-in with cocos2d-x v3.0beta.

Summary

Since the new rendering pipeline of cocos2d-x v3.x is still young. It needs more time and patient to be mature. We eager to hear your invaluable suggestions and comments of any kinds and definitely welcome to contribute by sending us pull request via github.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值