From c9d021cc360fb7902f3f752b3f4133a087c28a83 Mon Sep 17 00:00:00 2001 From: hybrid Date: Sun, 20 Mar 2011 11:40:00 +0000 Subject: [PATCH] Fix transparency materials in particle systems. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3615 dfc29bdd-3216-0410-991c-e03cc46cb475 --- examples/11.PerPixelLighting/main.cpp | 6 +++--- examples/21.Quake3Explorer/main.cpp | 2 +- examples/Demo/CDemo.cpp | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/11.PerPixelLighting/main.cpp b/examples/11.PerPixelLighting/main.cpp index 5b8a0f9c..b308aa60 100644 --- a/examples/11.PerPixelLighting/main.cpp +++ b/examples/11.PerPixelLighting/main.cpp @@ -328,7 +328,7 @@ int main() // scale the mesh by factor 50 core::matrix4 m; m.setScale ( core::vector3df(50,50,50) ); - manipulator->transformMesh( tangentSphereMesh, m ); + manipulator->transform( tangentSphereMesh, m ); earth = smgr->addMeshSceneNode(tangentSphereMesh); @@ -427,7 +427,7 @@ int main() core::aabbox3d(-3,0,-3,3,1,3), core::vector3df(0.0f,0.03f,0.0f), 80,100, - video::SColor(0,255,255,255), video::SColor(0,255,255,255), + video::SColor(10,255,255,255), video::SColor(10,255,255,255), 400,1100); em->setMinStartSize(core::dimension2d(30.0f, 40.0f)); em->setMaxStartSize(core::dimension2d(30.0f, 40.0f)); @@ -444,7 +444,7 @@ int main() ps->setMaterialFlag(video::EMF_LIGHTING, false); ps->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); ps->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp")); - ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA); + ps->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); MyEventReceiver receiver(room, earth, env, driver); device->setEventReceiver(&receiver); diff --git a/examples/21.Quake3Explorer/main.cpp b/examples/21.Quake3Explorer/main.cpp index 61501313..138330f4 100644 --- a/examples/21.Quake3Explorer/main.cpp +++ b/examples/21.Quake3Explorer/main.cpp @@ -1888,7 +1888,7 @@ void CQuake3EventHandler::createParticleImpacts( u32 now ) pas->setMaterialFlag(video::EMF_LIGHTING, false); pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - pas->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA ); + pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); pas->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture( smoke[g].texture )); } diff --git a/examples/Demo/CDemo.cpp b/examples/Demo/CDemo.cpp index 3e726b06..93087b2b 100644 --- a/examples/Demo/CDemo.cpp +++ b/examples/Demo/CDemo.cpp @@ -525,7 +525,7 @@ void CDemo::loadSceneData() scene::IParticleEmitter* em = campFire->createBoxEmitter( core::aabbox3d(-7,0,-7,7,1,7), core::vector3df(0.0f,0.06f,0.0f), - 80,100, video::SColor(0,255,255,255),video::SColor(0,255,255,255), 800,2000); + 80,100, video::SColor(1,255,255,255),video::SColor(1,255,255,255), 800,2000); em->setMinStartSize(core::dimension2d(20.0f, 10.0f)); em->setMaxStartSize(core::dimension2d(20.0f, 10.0f)); @@ -539,7 +539,8 @@ void CDemo::loadSceneData() campFire->setMaterialFlag(video::EMF_LIGHTING, false); campFire->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); campFire->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp")); - campFire->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA); + campFire->setMaterialType(video::EMT_ONETEXTURE_BLEND); + campFire->getMaterial(0).MaterialTypeParam=video::pack_texureBlendFunc(video::EBF_ONE, video::EBF_ONE_MINUS_SRC_ALPHA, video::EMFN_MODULATE_1X, video::EAS_VERTEX_COLOR); // load music