Will Cocos2d-js support 3D on web? what is render mode?

Hello. Can anyone answer my questions:

  1. Now Cocos2d-js supported 3D game on native platforms, but there is no 3D on web, so in the future, will Cocos-js be able to make 3D game which can run on web natively ?
  2. Can anyone explain the render mode in “project.json” and differences beetwen them.
  3. Do Cocos2d-js and cocos2d-x (c++) have the same performance?

thanks u so much! have a good weekend!

@pandamicro @Zinitter
please :slight_smile:

@Pantoo

I’m not very sure about the engine plan and some of the features, but i can try to explain what i understand.

  1. If not remember wrong, someone has ask these question before. @pandamicro have stated 3D features may not or not so soon to be supported on web. And we can’t use 3D features on web since it only support native platforms.

  2. RenderMode, normal should just leave it as 0 which is auto select.

Here are the explanation from the main.js

"renderMode"    : 0,
// "renderMode" sets the renderer type, only useful on web :
//      0 - Automatically chosen by engine
//      1 - Forced to use canvas renderer
//      2 - Forced to use WebGL renderer, but this will be ignored on mobile browsers

3.Cocos2d-JS and Cocos2d-X should have same performance but there are some differences as i noticed. There are pros and cons, so just choose which fit your coding style.

  • Cocos2d-JS is coding in Javascript and support to run on native and web platforms. Cocos2d-X is coding in C++ and only run on native platforms.

  • Cocos2d-JS app size would be larger than Cocos2d-X on native as they need Javascript Binding(JSB) and SpiderMonkey to execute the code. (I have read someone post stated the blank app of Cocos2d-X can be in few 3-4MB while Cocos2d-JS at least 10MB)

  • You have to create Javascript Binding(JSB) for Cocos2d-JS if you want to use features not included in the engine besides the C++ code.

Hope these help.

If i stated something wrong, please don’t hesitate to point out.

1 Like

Thanks u for great answer :smiley: I choosed Cocos2d-js to make games, it s easy and powerfull with web and native platforms support.
I still dont understand the diffenent beetwen “canvas renderer” and “Web GL renderer” , should I use Web GL render mode or Canvas renderer or let the engine choose render mode automatically.
thanks again!

@Pantoo

I just tested the renderMode on web.

0 - Automatically chosen by engine

The label looks bold, should be in WebGL renderer mode.

1 - Forced to use canvas renderer

The label looks thin.

2 - Forced to use WebGL renderer, but this will be ignored on mobile browsers

The label looks bold.

I’m not sure is there any other difference but i suggest just put 0 to auto choose by engine unless you notice any issue.

1 Like

thanks you so much :slight_smile:

@Pantoo

Reference for your question 1.

1 Like