Cocos2d-x v3.6alpha0 Released

We are happy to announce that cocos2d-x v3.6alpha0 is released.

Download

cocos2d-x-3.6alpha0.zip

Highlights of v3.6alpha0

  • 3D: added texturecube support
  • 3D: added skybox support
  • 3D: added terrain support
  • uses luajit v2.1-20150331 on 64-bit iOS devices
  • added test automation support for cpp-tests
  • 3rd: updated libcurl to v7.4 on all supported platforms except WP8/WP8.1 universal
  • 3rd: updated chipmunk to v6.2.2
  • 3rd: updated openssl to v1.0.11
  • 3rd: updated freetype to v2.5.5
  • 3rd: updated png to v1.6.16 on all supported platforms except WP8/WP8.1 universal because it is not needed on these two platforms

Features in detail

3D TextureCube

TextureCube is useful for skybox and environment mapping. It uses 6 faces of a cube as map shape, and 6 pictures are projected onto the sides of a cube and stored as six square textures.

TexturesCube usage

auto texturecube = TextureCube::create("left.jpg", "right.jpg", "top.jpg", "bottom.jpg","front.jpg", "back.jpg");
//set texture parameters
Texture2D::TexParams tRepeatParams;
tRepeatParams.magFilter = GL_NEAREST;
tRepeatParams.minFilter = GL_NEAREST;
tRepeatParams.wrapS = GL_MIRRORED_REPEAT;
tRepeatParams.wrapT = GL_MIRRORED_REPEAT;
texturecube->setTexParameters(tRepeatParams);

//create a GLProgramState using custom shader
auto shader = GLProgram::createWithFilenames("cube_map.vert", "cube_map.frag");
auto state = GLProgramState::create(shader);
// pass the texture sampler to our custom shader, state is a pointer of GLProgramState, u_cubeTex is a uniform in shader
state->setUniformTexture("u_cubeTex", texturecube);

Then the shader cube_map.frag can be something like this,

varying vec3        v_reflect; //reflect direction
uniform samplerCube u_cubeTex;

void main(void)
{
    gl_FragColor = textureCube(u_cubeTex, v_reflect); //sample the color of reflection direction
}

For more information please refer to cpp-tests/Sprite3DTest/Sprite3DCubeMapTest.

3D Skybox

Skybox is a common component in 3D game. It is based on TextureCube.

Usage of skybox

// create a texture cube
auto textureCube = TextureCube::create("left.jpg", "right.jpg","top.jpg", "bottom.jpg","front.jpg", "back.jpg");
//create a skybox
auto skyBox = Skybox::create();
skyBox->retain();
//set cube texture to the skybox
skyBox->setTexture(textureCube);
addChild(_skyBox);

For more information please refer to cpp-tests/Sprite3DTest/Sprite3DCubeMapTest.

tecturecube-and-skybox

3D Terrain

Terrain is an important component in 3D game. A texture is used to stand for the height map. And up to 4 textures can be used to blend the details of the terrain, grass, road, and so on.

Usage of terrain

//blended layers
Terrain::DetailMap dirt("TerrainTest/dirt.jpg"), grass("TerrainTest/Grass2.jpg"), road("TerrainTest/road.jpg"), green("TerrainTest/GreenSkin.jpg");

//height map, alpha map (blend weight), and blended layers
Terrain::TerrainData data("TerrainTest/heightmap16.jpg", "TerrainTest/alphamap.png", dirt, grass, road, green);

//create terrain here
_terrain = Terrain::create(data,Terrain::CrackFixedType::SKIRT);
//set lod distance
_terrain->setLODDistance(3.2,6.4,9.6);
//it must be less than 5
_terrain->setMaxDetailMapAmount(4);
addChild(_terrain);

For more information please refer to cpp-tests/Sprite3DTest/TerrainTest.

terrian

Animate3D Quality Control

In order to make Animate3D run fast, you can use low quality animation.

std::string fileName = "Sprite3DTest/orc.c3b";
auto sprite = Sprite3D::create(fileName);
addChild(sprite);
    
auto animation = Animation3D::create(fileName);
if (animation)
{
   auto animate = Animate3D::create(animation);
   //use low quality animation
   animate->setHighQuality(false);
   sprite->runAction(RepeatForever::create(animate));
}

The animation quality is also configurable in config.plist, the key is cocos2d.x.3d.animate_high_quality. All the created Animate3D base on this key if exist. You can modify it using the above method.

luajit arm64

The version of the luajit is v2.1-20150331. We have consulted the author of luajit, he said it was stability enough to be used. We will update to v2.1 when it is released.

Using luajit arm64 version is that because it can improve the performance. In previous versions of cocos2d-x, it uses lua on iOS 64-bit devices.

Bytecode of luajit and luajit arm64 are not compatible, which means you can not use one version of bytecode on iOS 32-bit devices and iOS 64-bit devices.

As there is not mandatory requirement of having arm64 bit bin on Android, so we don’t use luajit arm64 on Android as its bytecode is not compatible with luajit arm32.

More information

For further information please read:

We would appreciate if you can test this version and report any possible bugs.
Thank you!

1 Like

Happy for this release… Cocos2dx will ne good for 2d and 3d

Thanks cocos2dx team for all hard work

can’t not compile with vs2012, because of the png library.

For the first time I would be writing a little bad review.

I’ve read somewhere in forums that release cycle of cocos2d-x is very fast.
But so much fast !

I don’t know how much worth is it?
Changes does seem to be significant but isn’t it better to release a little later but with more features?

Or is it that creating many changes at once will make it difficult for users to try alpha version

For alpha and beta version, it should use on testing new features and report the bugs if you found.

This is because it might not stable enough and advised not to be used in development as it labeled version.

So if you want to try, you are actually helping Cocos team to improve and fix problems of the engine.
Your help and testing can speed up the release of stable version which benefit all to enjoy the new features earlier.

As i read on somewhere, only final version will be published on cocos website, other version like alpha, beta, and rc will post on forum to avoid confuse user.

I didn’t get how was that answered my question.
What you told, I know and understand it.

You may like to read this again,

I actually meant that v3.5 was very recently launched, so instead changes of v3.6 could have been merged with v3.5 and v3.5 with more features could have been released !

But I think

This must be the reason.

For what i know, there are many rules on the version label.
A released version can’t add in new features.

So they have to add the features on v3.6 but not v3.5.

From http://discuss.cocos2d-x.org/t/v4-develop-viable/20976

I think Cocos team delay the release of v4, that should be one of the reason they release more version on v3.x.

I do agreed that released of new version with very less new features make trouble for developer, to upgrade or not to upgrade.
However, the new version would fixed some bugs and improve certain things that we might don’t know.

I just trying to answer but it seem i better leave the question to Cocos team as they are more understand about the plan of Cocos2d-x and the reason behind the version.

No, I didn’t mean to say that either. I just meant that instead of releasing v3.5 they could have delayed release and add more features in v3.5 alpha and put it on forums and then simply release a version with more features instead of releasing it regularly.

And v4 is entirely different, so I won’t talk about it bcoz. its no version has been started yet!

I think we should stop discuss and wait for the answer from Cocos team.

It is not good to hijack a version release topic.

Congratz to the release of Cocos2d-x v3.6 alpha0

I agree to what catch_up is trying to say they could have easily combined the features of 3.4,3.5 and 3.6 into one single release

and all the bugs who were filed in from 3.4 to 3.6 would be in the “single release”.

I personally prefer to have the features ready as soon as possible provided that they are high quality.

What would you prefer, to have 1 feature ready per month, or 12 per year ?
I prefer to have 1 per month because I don’t have to wait one year to use it.

2 feature per month :smiley: is better

(And I hope u have given numbers - 1 feature - 2 features proportionately, so if 5 features in a months then 10 features in 2 months is a better idea.)

Quick releases with bug fixes and new features :thumbsup:
I don’t even mind breaking backward compatibility if it brings improvements. Too much software is hobbled by past decisions.