From 3505cc1679dc351e5a344b111e1a452d38c5846d Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 28 Apr 2015 18:05:18 +0800 Subject: [PATCH 1/2] modify releasenote --- docs/RELEASE_NOTES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 2c0f82e608..818694452a 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -223,7 +223,7 @@ For more information please refer to cpp-tests/Sprite3DTest/TerrainTest. ### Animate3D Quality Control -In order to make `Animate3D` run fast, you can use low quality animation. +In order to make `Animate3D` run fast, you can use low quality animation. There are three types of animation quality, `Animate3DQuality::QUALITY_NONE`, `Animate3DQuality::QUALITY_LOW` and `Animate3DQuality::QUALITY_HIGH`. `Animate3DQuality::QUALITY_NONE` means that does not update the animation you can use this when you are sure that the `Sprite3D` is out of screen. `Animate3DQuality::QUALITY_LOW` uses the nearest frame, and `Animate3DQuality::QUALITY_LOW` interpolate current frame using the nearest two frames. ```c++ std::string fileName = "Sprite3DTest/orc.c3b"; @@ -235,7 +235,7 @@ if (animation) { auto animate = Animate3D::create(animation); //use low quality animation - animate->setHighQuality(false); + animate->setQuality(Animate3DQuality::QUALITY_LOW); sprite->runAction(RepeatForever::create(animate)); } ``` From f25c02f230b8a2f4a4de9c0d9be16c0a17d36064 Mon Sep 17 00:00:00 2001 From: songchengjiang Date: Mon, 11 May 2015 12:02:32 +0800 Subject: [PATCH 2/2] fix bugs of terrain --- cocos/3d/CCTerrain.cpp | 2 ++ cocos/renderer/ccShader_3D_Terrain.frag | 2 +- .../Classes/TerrainTest/TerrainTest.cpp | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cocos/3d/CCTerrain.cpp b/cocos/3d/CCTerrain.cpp index 3686b5d83d..2c2b78fed0 100644 --- a/cocos/3d/CCTerrain.cpp +++ b/cocos/3d/CCTerrain.cpp @@ -262,6 +262,8 @@ bool Terrain::initHeightMap(const char * heightMap) Terrain::Terrain() { _alphaMap = nullptr; + _customCommand.setTransparent(false); + _customCommand.set3D(true); #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) auto _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) diff --git a/cocos/renderer/ccShader_3D_Terrain.frag b/cocos/renderer/ccShader_3D_Terrain.frag index b853800f9f..b7b226a45c 100644 --- a/cocos/renderer/ccShader_3D_Terrain.frag +++ b/cocos/renderer/ccShader_3D_Terrain.frag @@ -28,7 +28,7 @@ if(u_has_alpha<=0) texture2D(u_texture1, v_texCoord*u_detailSize[1])*blendFactor.g + texture2D(u_texture2, v_texCoord*u_detailSize[2])*blendFactor.b;\n float grayFactor =dot(blendFactor.rgb, vec3(1, 1, 1)); color +=texture2D(u_texture3, v_texCoord*u_detailSize[3])*(1.0-grayFactor); - gl_FragColor = color*lightFactor; + gl_FragColor = vec4(color.rgb*lightFactor, 1.0); } } ); diff --git a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp index b9ee1feba0..5ebe990dee 100644 --- a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp +++ b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.cpp @@ -34,6 +34,12 @@ TerrainSimple::TerrainSimple() auto listener = EventListenerTouchAllAtOnce::create(); listener->onTouchesMoved = CC_CALLBACK_2(TerrainSimple::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); + // add Particle3D for test blend + auto rootps = PUParticleSystem3D::create("Particle3D/scripts/mp_torch.pu"); + rootps->setCameraMask((unsigned short)CameraFlag::USER1); + rootps->startParticleSystem(); + + this->addChild(rootps, 0, 0); } std::string TerrainSimple::title() const @@ -107,6 +113,19 @@ TerrainWalkThru::TerrainWalkThru() _player->setCameraMask(2); _player->setScale(0.08); _player->setPositionY(_terrain->getHeight(_player->getPositionX(),_player->getPositionZ())+PLAYER_HEIGHT); + + // add Particle3D for test blend + auto rootps = PUParticleSystem3D::create("Particle3D/scripts/mp_torch.pu"); + rootps->setCameraMask((unsigned short)CameraFlag::USER1); + rootps->setScale(30.0f); + rootps->startParticleSystem(); + _player->addChild(rootps); + + // add BillBoard for test blend + auto billboard = BillBoard::create("Images/btn-play-normal.png"); + billboard->setPosition3D(Vec3(0,180,0)); + billboard->setCameraMask((unsigned short)CameraFlag::USER1); + _player->addChild(billboard); auto animation = Animation3D::create("Sprite3DTest/girl.c3b","Take 001"); if (animation)