mirror of https://github.com/axmolengine/axmol.git
Merge pull request #10980 from super626/v3
3d particle performance test
This commit is contained in:
commit
1aec5a9508
|
@ -816,6 +816,8 @@
|
||||||
B2507B6C192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; };
|
B2507B6C192589AF00FA4972 /* Shaders3D in Resources */ = {isa = PBXBuildFile; fileRef = B2507B6A192589AF00FA4972 /* Shaders3D */; };
|
||||||
B609E67319C18DAD003D0074 /* BillBoardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B609E67119C18DAD003D0074 /* BillBoardTest.cpp */; };
|
B609E67319C18DAD003D0074 /* BillBoardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B609E67119C18DAD003D0074 /* BillBoardTest.cpp */; };
|
||||||
B609E67419C18DAD003D0074 /* BillBoardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B609E67119C18DAD003D0074 /* BillBoardTest.cpp */; };
|
B609E67419C18DAD003D0074 /* BillBoardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B609E67119C18DAD003D0074 /* BillBoardTest.cpp */; };
|
||||||
|
B6337DF71ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6337DF51ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp */; };
|
||||||
|
B6337DF81ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6337DF51ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp */; };
|
||||||
B639932E1A490EC700B07923 /* Particle3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B639932C1A490EC700B07923 /* Particle3DTest.cpp */; };
|
B639932E1A490EC700B07923 /* Particle3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B639932C1A490EC700B07923 /* Particle3DTest.cpp */; };
|
||||||
B639932F1A490EC700B07923 /* Particle3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B639932C1A490EC700B07923 /* Particle3DTest.cpp */; };
|
B639932F1A490EC700B07923 /* Particle3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B639932C1A490EC700B07923 /* Particle3DTest.cpp */; };
|
||||||
B63993311A49359F00B07923 /* Particle3D in Resources */ = {isa = PBXBuildFile; fileRef = B63993301A49359F00B07923 /* Particle3D */; };
|
B63993311A49359F00B07923 /* Particle3D in Resources */ = {isa = PBXBuildFile; fileRef = B63993301A49359F00B07923 /* Particle3D */; };
|
||||||
|
@ -1752,6 +1754,8 @@
|
||||||
B2507B6A192589AF00FA4972 /* Shaders3D */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Shaders3D; path = "../tests/cpp-tests/Resources/Shaders3D"; sourceTree = "<group>"; };
|
B2507B6A192589AF00FA4972 /* Shaders3D */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Shaders3D; path = "../tests/cpp-tests/Resources/Shaders3D"; sourceTree = "<group>"; };
|
||||||
B609E67119C18DAD003D0074 /* BillBoardTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BillBoardTest.cpp; path = BillBoardTest/BillBoardTest.cpp; sourceTree = "<group>"; };
|
B609E67119C18DAD003D0074 /* BillBoardTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BillBoardTest.cpp; path = BillBoardTest/BillBoardTest.cpp; sourceTree = "<group>"; };
|
||||||
B609E67219C18DAD003D0074 /* BillBoardTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BillBoardTest.h; path = BillBoardTest/BillBoardTest.h; sourceTree = "<group>"; };
|
B609E67219C18DAD003D0074 /* BillBoardTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BillBoardTest.h; path = BillBoardTest/BillBoardTest.h; sourceTree = "<group>"; };
|
||||||
|
B6337DF51ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceParticle3DTest.cpp; sourceTree = "<group>"; };
|
||||||
|
B6337DF61ABA9B44005AEF24 /* PerformanceParticle3DTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceParticle3DTest.h; sourceTree = "<group>"; };
|
||||||
B639932C1A490EC700B07923 /* Particle3DTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Particle3DTest.cpp; path = Particle3DTest/Particle3DTest.cpp; sourceTree = "<group>"; };
|
B639932C1A490EC700B07923 /* Particle3DTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Particle3DTest.cpp; path = Particle3DTest/Particle3DTest.cpp; sourceTree = "<group>"; };
|
||||||
B639932D1A490EC700B07923 /* Particle3DTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Particle3DTest.h; path = Particle3DTest/Particle3DTest.h; sourceTree = "<group>"; };
|
B639932D1A490EC700B07923 /* Particle3DTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Particle3DTest.h; path = Particle3DTest/Particle3DTest.h; sourceTree = "<group>"; };
|
||||||
B63993301A49359F00B07923 /* Particle3D */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Particle3D; path = "../tests/cpp-tests/Resources/Particle3D"; sourceTree = "<group>"; };
|
B63993301A49359F00B07923 /* Particle3D */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Particle3D; path = "../tests/cpp-tests/Resources/Particle3D"; sourceTree = "<group>"; };
|
||||||
|
@ -2939,6 +2943,8 @@
|
||||||
1AC35AC118CECF0C00F37B72 /* PerformanceTest */ = {
|
1AC35AC118CECF0C00F37B72 /* PerformanceTest */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
B6337DF51ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp */,
|
||||||
|
B6337DF61ABA9B44005AEF24 /* PerformanceParticle3DTest.h */,
|
||||||
1AC35AC218CECF0C00F37B72 /* PerformanceAllocTest.cpp */,
|
1AC35AC218CECF0C00F37B72 /* PerformanceAllocTest.cpp */,
|
||||||
1AC35AC318CECF0C00F37B72 /* PerformanceAllocTest.h */,
|
1AC35AC318CECF0C00F37B72 /* PerformanceAllocTest.h */,
|
||||||
1AF152D718FD252A00A52F3D /* PerformanceCallbackTest.cpp */,
|
1AF152D718FD252A00A52F3D /* PerformanceCallbackTest.cpp */,
|
||||||
|
@ -4866,6 +4872,7 @@
|
||||||
182C5CBA1A95B2FD00C30D34 /* CocosStudio3DTest.cpp in Sources */,
|
182C5CBA1A95B2FD00C30D34 /* CocosStudio3DTest.cpp in Sources */,
|
||||||
1AC35C5D18CECF0C00F37B72 /* Ball.cpp in Sources */,
|
1AC35C5D18CECF0C00F37B72 /* Ball.cpp in Sources */,
|
||||||
1AC35B7B18CECF0C00F37B72 /* GameOverScene.cpp in Sources */,
|
1AC35B7B18CECF0C00F37B72 /* GameOverScene.cpp in Sources */,
|
||||||
|
B6337DF71ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp in Sources */,
|
||||||
1AC35BF318CECF0C00F37B72 /* ExtensionsTest.cpp in Sources */,
|
1AC35BF318CECF0C00F37B72 /* ExtensionsTest.cpp in Sources */,
|
||||||
1AC35B3518CECF0C00F37B72 /* TestEntries.cpp in Sources */,
|
1AC35B3518CECF0C00F37B72 /* TestEntries.cpp in Sources */,
|
||||||
1AC35B2D18CECF0C00F37B72 /* Box2dTest.cpp in Sources */,
|
1AC35B2D18CECF0C00F37B72 /* Box2dTest.cpp in Sources */,
|
||||||
|
@ -5118,6 +5125,7 @@
|
||||||
1AC35C3E18CECF0C00F37B72 /* PhysicsTest.cpp in Sources */,
|
1AC35C3E18CECF0C00F37B72 /* PhysicsTest.cpp in Sources */,
|
||||||
3825CC4A1A2C982A00C92EA8 /* CustomRootNode.cpp in Sources */,
|
3825CC4A1A2C982A00C92EA8 /* CustomRootNode.cpp in Sources */,
|
||||||
29080DC6191B595E0066F8DF /* UIScene_Editor.cpp in Sources */,
|
29080DC6191B595E0066F8DF /* UIScene_Editor.cpp in Sources */,
|
||||||
|
B6337DF81ABA9B44005AEF24 /* PerformanceParticle3DTest.cpp in Sources */,
|
||||||
29080DB2191B595E0066F8DF /* UILayoutTest.cpp in Sources */,
|
29080DB2191B595E0066F8DF /* UILayoutTest.cpp in Sources */,
|
||||||
1AC35B6A18CECF0C00F37B72 /* ButtonTestLayer.cpp in Sources */,
|
1AC35B6A18CECF0C00F37B72 /* ButtonTestLayer.cpp in Sources */,
|
||||||
29080DB6191B595E0066F8DF /* UIListViewTest.cpp in Sources */,
|
29080DB6191B595E0066F8DF /* UIListViewTest.cpp in Sources */,
|
||||||
|
|
|
@ -155,6 +155,7 @@ set(TESTS_SRC
|
||||||
Classes/PerformanceTest/PerformanceAllocTest.cpp
|
Classes/PerformanceTest/PerformanceAllocTest.cpp
|
||||||
Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp
|
Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp
|
||||||
Classes/PerformanceTest/PerformanceParticleTest.cpp
|
Classes/PerformanceTest/PerformanceParticleTest.cpp
|
||||||
|
Classes/PerformanceTest/PerformanceParticle3DTest.cpp
|
||||||
Classes/PerformanceTest/PerformanceSpriteTest.cpp
|
Classes/PerformanceTest/PerformanceSpriteTest.cpp
|
||||||
Classes/PerformanceTest/PerformanceTest.cpp
|
Classes/PerformanceTest/PerformanceTest.cpp
|
||||||
Classes/PerformanceTest/PerformanceTextureTest.cpp
|
Classes/PerformanceTest/PerformanceTextureTest.cpp
|
||||||
|
|
|
@ -882,8 +882,9 @@ void CameraCullingDemo::update(float dt)
|
||||||
void CameraCullingDemo::reachEndCallBack()
|
void CameraCullingDemo::reachEndCallBack()
|
||||||
{
|
{
|
||||||
_cameraFirst->stopActionByTag(100);
|
_cameraFirst->stopActionByTag(100);
|
||||||
auto inverse = (MoveTo*)_moveAction->reverse();
|
auto inverse = MoveTo::create(4.f, Vec2(-_cameraFirst->getPositionX(), 0));
|
||||||
inverse->retain();
|
inverse->retain();
|
||||||
|
|
||||||
_moveAction->release();
|
_moveAction->release();
|
||||||
_moveAction = inverse;
|
_moveAction = inverse;
|
||||||
auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f));
|
auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f));
|
||||||
|
@ -902,7 +903,7 @@ void CameraCullingDemo::switchViewCallback(Ref* sender)
|
||||||
_cameraFirst->setCameraFlag(CameraFlag::USER8);
|
_cameraFirst->setCameraFlag(CameraFlag::USER8);
|
||||||
_cameraFirst->setPosition3D(Vec3(-100,0,0));
|
_cameraFirst->setPosition3D(Vec3(-100,0,0));
|
||||||
_cameraFirst->lookAt(Vec3(1000,0,0));
|
_cameraFirst->lookAt(Vec3(1000,0,0));
|
||||||
_moveAction = MoveTo::create(4.f, Vec2(100, 0));
|
_moveAction = MoveTo::create(4.f, Vec2(-_cameraFirst->getPositionX(), 0));
|
||||||
_moveAction->retain();
|
_moveAction->retain();
|
||||||
auto seq = Sequence::create(_moveAction, CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr);
|
auto seq = Sequence::create(_moveAction, CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr);
|
||||||
seq->setTag(100);
|
seq->setTag(100);
|
||||||
|
|
|
@ -0,0 +1,204 @@
|
||||||
|
#include "PerformanceParticle3DTest.h"
|
||||||
|
#include "Particle3D/PU/CCPUParticleSystem3D.h"
|
||||||
|
|
||||||
|
static int kTagInfoLayer = 1;
|
||||||
|
static int kTagMenuLayer = 1000;
|
||||||
|
static int kTagParticleSystem = 1001;
|
||||||
|
static int test_Count = 2;
|
||||||
|
|
||||||
|
static int kMaxParticles = 14000;
|
||||||
|
static int kNodesIncrease = 1;
|
||||||
|
|
||||||
|
static int s_parCurIdx = 0;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// ParticleMenuLayer
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
Particle3DMenuLayer::Particle3DMenuLayer(bool isControlMenuVisible, int maxCases, int curCase)
|
||||||
|
: PerformBasicLayer(isControlMenuVisible, maxCases, curCase)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Particle3DMenuLayer::showCurrentTest()
|
||||||
|
{
|
||||||
|
auto scene = (Particle3DMainScene*)getParent();
|
||||||
|
int subTest = scene->getSubTestNum();
|
||||||
|
int parNum = scene->getParticlesNum();
|
||||||
|
|
||||||
|
Particle3DMainScene* pNewScene = nullptr;
|
||||||
|
|
||||||
|
switch (_curCase)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
pNewScene = new (std::nothrow) Particle3DPerformTest;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_parCurIdx = _curCase;
|
||||||
|
if (pNewScene)
|
||||||
|
{
|
||||||
|
pNewScene->initWithSubTest(subTest, parNum);
|
||||||
|
|
||||||
|
Director::getInstance()->replaceScene(pNewScene);
|
||||||
|
pNewScene->release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// ParticleMainScene
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
void Particle3DMainScene::initWithSubTest(int asubtest, int particles)
|
||||||
|
{
|
||||||
|
//srandom(0);
|
||||||
|
|
||||||
|
_subtestNumber = asubtest;
|
||||||
|
auto s = Director::getInstance()->getWinSize();
|
||||||
|
|
||||||
|
_lastRenderedCount = 0;
|
||||||
|
_quantityParticles = 0;
|
||||||
|
|
||||||
|
MenuItemFont::setFontSize(65);
|
||||||
|
auto decrease = MenuItemFont::create(" - ", [=](Ref *sender) {
|
||||||
|
_quantityParticles -= kNodesIncrease;
|
||||||
|
if( _quantityParticles < 0 )
|
||||||
|
_quantityParticles = 0;
|
||||||
|
|
||||||
|
updateQuantityLabel();
|
||||||
|
removeChildByTag(kTagParticleSystem + _quantityParticles, true);
|
||||||
|
});
|
||||||
|
decrease->setColor(Color3B(0,200,20));
|
||||||
|
auto increase = MenuItemFont::create(" + ", [=](Ref *sender) {
|
||||||
|
_quantityParticles += kNodesIncrease;
|
||||||
|
if( _quantityParticles > kMaxParticles )
|
||||||
|
_quantityParticles = kMaxParticles;
|
||||||
|
|
||||||
|
updateQuantityLabel();
|
||||||
|
createParticleSystem(_quantityParticles - 1);
|
||||||
|
});
|
||||||
|
increase->setColor(Color3B(0,200,20));
|
||||||
|
|
||||||
|
auto menu = Menu::create(decrease, increase, nullptr);
|
||||||
|
menu->alignItemsHorizontally();
|
||||||
|
menu->setPosition(Vec2(s.width/2, s.height/2+15));
|
||||||
|
addChild(menu, 1);
|
||||||
|
|
||||||
|
auto infoLabel = Label::createWithTTF("0 Particle Systems", "fonts/Marker Felt.ttf", 30);
|
||||||
|
infoLabel->setColor(Color3B(0,200,20));
|
||||||
|
infoLabel->setPosition(Vec2(s.width/2, s.height - 90));
|
||||||
|
addChild(infoLabel, 1, kTagInfoLayer);
|
||||||
|
|
||||||
|
// Next Prev Test
|
||||||
|
auto menuLayer = new (std::nothrow) Particle3DMenuLayer(true, test_Count, s_parCurIdx);
|
||||||
|
addChild(menuLayer, 1, kTagMenuLayer);
|
||||||
|
menuLayer->release();
|
||||||
|
|
||||||
|
auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32);
|
||||||
|
addChild(label, 1);
|
||||||
|
label->setPosition(Vec2(s.width/2, s.height-50));
|
||||||
|
|
||||||
|
auto camera = Camera::createPerspective(30.0f, s.width / s.height, 1.0f, 1000.0f);
|
||||||
|
camera->setPosition3D(Vec3(0.0f, 0.0f, 150.0f));
|
||||||
|
camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f));
|
||||||
|
camera->setCameraFlag(CameraFlag::USER1);
|
||||||
|
this->addChild(camera);
|
||||||
|
|
||||||
|
TTFConfig config("fonts/tahoma.ttf",10);
|
||||||
|
_particleLab = Label::createWithTTF(config,"Particle Count: 0",TextHAlignment::LEFT);
|
||||||
|
_particleLab->setPosition(Vec2(0.0f, s.height / 6.0f));
|
||||||
|
_particleLab->setAnchorPoint(Vec2(0.0f, 0.0f));
|
||||||
|
this->addChild(_particleLab);
|
||||||
|
_quantityParticles = 1;
|
||||||
|
updateQuantityLabel();
|
||||||
|
createParticleSystem(_quantityParticles - 1);
|
||||||
|
|
||||||
|
schedule(CC_SCHEDULE_SELECTOR(Particle3DMainScene::step));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Particle3DMainScene::title() const
|
||||||
|
{
|
||||||
|
return "No title";
|
||||||
|
}
|
||||||
|
|
||||||
|
void Particle3DMainScene::step(float dt)
|
||||||
|
{
|
||||||
|
unsigned int count = 0;
|
||||||
|
for (int i = 0; i < _quantityParticles; i++)
|
||||||
|
{
|
||||||
|
ParticleSystem3D *ps = static_cast<ParticleSystem3D *>(this->getChildByTag(kTagParticleSystem + i));
|
||||||
|
if (ps){
|
||||||
|
auto children = ps->getChildren();
|
||||||
|
for (auto iter : children){
|
||||||
|
ParticleSystem3D *child = dynamic_cast<ParticleSystem3D *>(iter);
|
||||||
|
if (child){
|
||||||
|
count += child->getAliveParticleCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char str[128];
|
||||||
|
sprintf(str, "Particle Count: %d", count);
|
||||||
|
_particleLab->setString(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Particle3DMainScene::createParticleSystem(int idx)
|
||||||
|
{
|
||||||
|
auto ps = PUParticleSystem3D::create("Particle3D/scripts/example_004.pu", "Particle3D/materials/pu_example.material");
|
||||||
|
ps->setCameraMask((unsigned short)CameraFlag::USER1);
|
||||||
|
ps->setPosition(CCRANDOM_MINUS1_1() * 50.0f, CCRANDOM_MINUS1_1() * 20.0f);
|
||||||
|
ps->startParticleSystem();
|
||||||
|
addChild(ps, 0, kTagParticleSystem + idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Particle3DMainScene::testNCallback(Ref* sender)
|
||||||
|
{
|
||||||
|
_subtestNumber = static_cast<Node*>(sender)->getTag();
|
||||||
|
|
||||||
|
auto menu = static_cast<Particle3DMenuLayer*>( getChildByTag(kTagMenuLayer) );
|
||||||
|
menu->restartCallback(sender);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Particle3DMainScene::updateQuantityLabel()
|
||||||
|
{
|
||||||
|
if( _quantityParticles != _lastRenderedCount )
|
||||||
|
{
|
||||||
|
auto infoLabel = (Label *) getChildByTag(kTagInfoLayer);
|
||||||
|
char str[20] = {0};
|
||||||
|
sprintf(str, "%u Particle Systems", _quantityParticles);
|
||||||
|
infoLabel->setString(str);
|
||||||
|
|
||||||
|
_lastRenderedCount = _quantityParticles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// ParticlePerformTest1
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
std::string Particle3DPerformTest::title() const
|
||||||
|
{
|
||||||
|
char str[20] = {0};
|
||||||
|
sprintf(str, "Particle3D Test"/*, subtestNumber*/);
|
||||||
|
std::string strRet = str;
|
||||||
|
return strRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Particle3DPerformTest::doTest()
|
||||||
|
{
|
||||||
|
auto s = Director::getInstance()->getWinSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void runParticle3DTest()
|
||||||
|
{
|
||||||
|
auto scene = new (std::nothrow) Particle3DPerformTest;
|
||||||
|
scene->initWithSubTest(1, kNodesIncrease);
|
||||||
|
|
||||||
|
Director::getInstance()->replaceScene(scene);
|
||||||
|
scene->release();
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
#ifndef __PERFORMANCE_PARTICLE_3D_TEST_H__
|
||||||
|
#define __PERFORMANCE_PARTICLE_3D_TEST_H__
|
||||||
|
|
||||||
|
#include "PerformanceTest.h"
|
||||||
|
|
||||||
|
class Particle3DMenuLayer : public PerformBasicLayer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Particle3DMenuLayer(bool isControlMenuVisible, int maxCases = 0, int curCase = 0);
|
||||||
|
virtual void showCurrentTest();
|
||||||
|
};
|
||||||
|
|
||||||
|
class Particle3DMainScene : public Scene
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void initWithSubTest(int subtest, int particles);
|
||||||
|
virtual std::string title() const;
|
||||||
|
|
||||||
|
void step(float dt);
|
||||||
|
void createParticleSystem(int idx);
|
||||||
|
void testNCallback(Ref* sender);
|
||||||
|
void updateQuantityLabel();
|
||||||
|
int getSubTestNum() { return _subtestNumber; }
|
||||||
|
int getParticlesNum() { return _quantityParticles; }
|
||||||
|
virtual void doTest() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int _lastRenderedCount;
|
||||||
|
int _quantityParticles;
|
||||||
|
int _subtestNumber;
|
||||||
|
cocos2d::Label *_particleLab;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Particle3DPerformTest : public Particle3DMainScene
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual std::string title() const override;
|
||||||
|
virtual void doTest();
|
||||||
|
};
|
||||||
|
|
||||||
|
void runParticle3DTest();
|
||||||
|
|
||||||
|
#endif
|
|
@ -2,6 +2,7 @@
|
||||||
#include "../testResource.h"
|
#include "../testResource.h"
|
||||||
#include "PerformanceNodeChildrenTest.h"
|
#include "PerformanceNodeChildrenTest.h"
|
||||||
#include "PerformanceParticleTest.h"
|
#include "PerformanceParticleTest.h"
|
||||||
|
#include "PerformanceParticle3DTest.h"
|
||||||
#include "PerformanceSpriteTest.h"
|
#include "PerformanceSpriteTest.h"
|
||||||
#include "PerformanceTextureTest.h"
|
#include "PerformanceTextureTest.h"
|
||||||
#include "PerformanceTouchesTest.h"
|
#include "PerformanceTouchesTest.h"
|
||||||
|
@ -28,6 +29,7 @@ struct {
|
||||||
{ "Alloc Test", [](Ref*sender){runAllocPerformanceTest(); } },
|
{ "Alloc Test", [](Ref*sender){runAllocPerformanceTest(); } },
|
||||||
{ "NodeChildren Test", [](Ref*sender){runNodeChildrenTest();} },
|
{ "NodeChildren Test", [](Ref*sender){runNodeChildrenTest();} },
|
||||||
{ "Particle Test",[](Ref*sender){runParticleTest();} },
|
{ "Particle Test",[](Ref*sender){runParticleTest();} },
|
||||||
|
{ "Particle3D Perf Test",[](Ref*sender){runParticle3DTest();} },
|
||||||
{ "Sprite Perf Test",[](Ref*sender){runSpriteTest();} },
|
{ "Sprite Perf Test",[](Ref*sender){runSpriteTest();} },
|
||||||
{ "Texture Perf Test",[](Ref*sender){runTextureTest();} },
|
{ "Texture Perf Test",[](Ref*sender){runTextureTest();} },
|
||||||
{ "Touches Perf Test",[](Ref*sender){runTouchesTest();} },
|
{ "Touches Perf Test",[](Ref*sender){runTouchesTest();} },
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
system example_004
|
||||||
|
{
|
||||||
|
category Examples_1_10
|
||||||
|
technique
|
||||||
|
{
|
||||||
|
visual_particle_quota 100
|
||||||
|
material ParticleUniverse/Star
|
||||||
|
default_particle_width 0.6
|
||||||
|
default_particle_height 0.6
|
||||||
|
renderer Billboard
|
||||||
|
{
|
||||||
|
}
|
||||||
|
emitter SphereSurface
|
||||||
|
{
|
||||||
|
emission_rate 60
|
||||||
|
time_to_live 1.8
|
||||||
|
velocity 0
|
||||||
|
direction 0 0 0
|
||||||
|
radius 3
|
||||||
|
}
|
||||||
|
affector Colour
|
||||||
|
{
|
||||||
|
time_colour 0 1 1 0 1
|
||||||
|
time_colour 1 1 0 0 0
|
||||||
|
}
|
||||||
|
affector Gravity
|
||||||
|
{
|
||||||
|
mass_affector 0.03
|
||||||
|
gravity 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -158,6 +158,7 @@ LOCAL_SRC_FILES := main.cpp \
|
||||||
../../Classes/PerformanceTest/PerformanceAllocTest.cpp \
|
../../Classes/PerformanceTest/PerformanceAllocTest.cpp \
|
||||||
../../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \
|
../../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \
|
||||||
../../Classes/PerformanceTest/PerformanceParticleTest.cpp \
|
../../Classes/PerformanceTest/PerformanceParticleTest.cpp \
|
||||||
|
../../Classes/PerformanceTest/PerformanceParticle3DTest.cpp \
|
||||||
../../Classes/PerformanceTest/PerformanceSpriteTest.cpp \
|
../../Classes/PerformanceTest/PerformanceSpriteTest.cpp \
|
||||||
../../Classes/PerformanceTest/PerformanceTest.cpp \
|
../../Classes/PerformanceTest/PerformanceTest.cpp \
|
||||||
../../Classes/PerformanceTest/PerformanceTextureTest.cpp \
|
../../Classes/PerformanceTest/PerformanceTextureTest.cpp \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
@ -195,6 +195,7 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y</Command>
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceEventDispatcherTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceEventDispatcherTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceLabelTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceLabelTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceMathTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceMathTest.cpp" />
|
||||||
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceParticle3DTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceRendererTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceRendererTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\PerformanceTest\PerformanceScenarioTest.cpp" />
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceScenarioTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\PhysicsTest\PhysicsTest.cpp" />
|
<ClCompile Include="..\Classes\PhysicsTest\PhysicsTest.cpp" />
|
||||||
|
@ -394,6 +395,7 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y</Command>
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceEventDispatcherTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceEventDispatcherTest.h" />
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceLabelTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceLabelTest.h" />
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceMathTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceMathTest.h" />
|
||||||
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceParticle3DTest.h" />
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceRendererTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceRendererTest.h" />
|
||||||
<ClInclude Include="..\Classes\PerformanceTest\PerformanceScenarioTest.h" />
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceScenarioTest.h" />
|
||||||
<ClInclude Include="..\Classes\PhysicsTest\PhysicsTest.h" />
|
<ClInclude Include="..\Classes\PhysicsTest\PhysicsTest.h" />
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="win32">
|
<Filter Include="win32">
|
||||||
|
@ -921,6 +921,9 @@
|
||||||
<ClCompile Include="..\Classes\AllocatorTest\AllocatorTest.cpp">
|
<ClCompile Include="..\Classes\AllocatorTest\AllocatorTest.cpp">
|
||||||
<Filter>Classes\AllocatorTest</Filter>
|
<Filter>Classes\AllocatorTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Classes\PerformanceTest\PerformanceParticle3DTest.cpp">
|
||||||
|
<Filter>Classes\PerformanceTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="main.h">
|
<ClInclude Include="main.h">
|
||||||
|
@ -1688,5 +1691,8 @@
|
||||||
<ClInclude Include="..\Classes\AllocatorTest\AllocatorTest.h">
|
<ClInclude Include="..\Classes\AllocatorTest\AllocatorTest.h">
|
||||||
<Filter>Classes\AllocatorTest</Filter>
|
<Filter>Classes\AllocatorTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Classes\PerformanceTest\PerformanceParticle3DTest.h">
|
||||||
|
<Filter>Classes\PerformanceTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -124,6 +124,7 @@
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceLabelTest.cpp" />
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceLabelTest.cpp" />
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceMathTest.cpp" />
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceMathTest.cpp" />
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceNodeChildrenTest.cpp" />
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceNodeChildrenTest.cpp" />
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticle3DTest.cpp" />
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticleTest.cpp" />
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticleTest.cpp" />
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceRendererTest.cpp" />
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceRendererTest.cpp" />
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceScenarioTest.cpp" />
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceScenarioTest.cpp" />
|
||||||
|
@ -384,6 +385,7 @@
|
||||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceLabelTest.h" />
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceLabelTest.h" />
|
||||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceMathTest.h" />
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceMathTest.h" />
|
||||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceNodeChildrenTest.h" />
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceNodeChildrenTest.h" />
|
||||||
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticle3DTest.h" />
|
||||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticleTest.h" />
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticleTest.h" />
|
||||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceRendererTest.h" />
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceRendererTest.h" />
|
||||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceScenarioTest.h" />
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceScenarioTest.h" />
|
||||||
|
|
|
@ -772,6 +772,9 @@
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\CocosStudio3DTest\CocosStudio3DTest.cpp">
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\CocosStudio3DTest\CocosStudio3DTest.cpp">
|
||||||
<Filter>Classes\CocosStudio3DTest</Filter>
|
<Filter>Classes\CocosStudio3DTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticle3DTest.cpp">
|
||||||
|
<Filter>Classes\PerformanceTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\ActionManagerTest\ActionManagerTest.cpp">
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Classes\ActionManagerTest\ActionManagerTest.cpp">
|
||||||
|
@ -1701,5 +1704,8 @@
|
||||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\CocosStudio3DTest\CocosStudio3DTest.h">
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\CocosStudio3DTest\CocosStudio3DTest.h">
|
||||||
<Filter>Classes\CocosStudio3DTest</Filter>
|
<Filter>Classes\CocosStudio3DTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Classes\PerformanceTest\PerformanceParticle3DTest.h">
|
||||||
|
<Filter>Classes\PerformanceTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue