Particles currently broken? Topic is solved

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Particles currently broken?

Post by xrgo »

[Ogre 2.1] Hi! I just noticed that particles don't show... this piece of code used to work a few months ago:

Code: Select all

    Ogre::ParticleSystem* newParticleSystem = sceneManager->createParticleSystem( 1000 );
    newParticleSystem->setDefaultDimensions(50,50);
    newParticleSystem->setIterationInterval(0.033);
    newParticleSystem->setKeepParticlesInLocalSpace(false);

    Ogre::SceneNode* node = sceneManager->getRootSceneNode()->createChildSceneNode();
    node->scale(Ogre::Vector3::UNIT_SCALE);
    node->setPosition(0,0,0);
    node->attachObject( newParticleSystem );

    Ogre::BoxEmitter* newEmitter = (Ogre::BoxEmitter*)newParticleSystem->addEmitter("Box");
    newEmitter->setWidth( 1 );
    newEmitter->setHeight( 1 );
    newEmitter->setDepth( 1 );
    newEmitter->setTimeToLive( 3 );
    newEmitter->setParticleVelocity( 200 );
    newEmitter->setEmissionRate( 10 );

    Ogre::HlmsUnlitDatablock *datablock = static_cast<Ogre::HlmsUnlitDatablock*>( Ogre::Root::getSingletonPtr()->getHlmsManager()->getHlms( Ogre::HLMS_UNLIT )->createDatablock( "particleMat", "particleMat", Ogre::HlmsMacroblock(), Ogre::HlmsBlendblock(), Ogre::HlmsParamVec()) );

    newParticleSystem->setMaterialName("particleMat");
haven't looked at it deeply, just want confirmation =)

Thanks!
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Particles currently broken?

Post by dark_sylinc »

I made two changes to Unlit: https://bitbucket.org/sinbad/ogre/commi ... ef21390ec9 and https://bitbucket.org/sinbad/ogre/commi ... 9532304e74 very recently.

Perhaps that broke particle FXs?
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Particles currently broken?

Post by xrgo »

thank you! but I found the culprit... at some point I added to my engine this line:

Code: Select all

mSceneManager->getRenderQueue()->setRenderQueueMode( 1, Ogre::RenderQueue::FAST );
for some reason this makes the particles invisible =)

edit: lol thanks, forgot particles are v1 stuff
Last edited by xrgo on Fri Mar 09, 2018 3:24 pm, edited 1 time in total.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Particles currently broken?

Post by dark_sylinc »

Phew! Good to know.

Yeah, v1 objects by default go to RQ 1 while v2 objects go to RQ 0; thus you either leave RQ 1 for v1 objects, or you call setRenderQueueGroup( n ) where n is something different that is a v1 render queue.

What it is curious is that Ogre didn't warn nor crash.
Post Reply