Ogre 2.1 imgui _injectRenderWithPass

Problems building or running the engine, queries about how to use features etc.
Post Reply
IndieGuy11
Halfling
Posts: 50
Joined: Fri May 19, 2017 8:09 pm
x 2

Ogre 2.1 imgui _injectRenderWithPass

Post by IndieGuy11 »

Hello,

Wonder if this feature was cut:
http://www.ogre3d.org/docs/api/2.1/clas ... 7bd1f38a9a

Because it is still listed but I can not be used.

Any other work around functions (trying to get imgui working) from here: https://bitbucket.org/ChaosCreator/imgu ... ?at=master

Thanks!
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by paroj »

the api docs you reference are outdated, take a look at: https://ogrecave.github.io/ogre/api/2.1/
IndieGuy11
Halfling
Posts: 50
Joined: Fri May 19, 2017 8:09 pm
x 2

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by IndieGuy11 »

Haha, many thanks! Opps!
JamesAMD
Gnoblar
Posts: 3
Joined: Sat Sep 03, 2016 4:57 pm

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by JamesAMD »

Did you manage to get it working ?
Apparently _setHlmsBlendblock, _setHlmsMacroblock, _injectRenderWithPass are all deprecated.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1279
Contact:

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by dark_sylinc »

Someone started porting it to latest using the PsoCacheHelper, but he didn't seem to succeed, although from a glance at his code it sounds like he should have been pretty close.
User avatar
Herb
Orc
Posts: 412
Joined: Thu Jun 04, 2009 3:21 am
Location: Kalamazoo,MI
x 38

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by Herb »

Code ran and walking through things, all the objects in the code looked right....just nothing was rendering on the screen. I can do shader work, but I'm a bit lost on how all the PsoCache stuff is working internally to Ogre. I'm guessing it's close, probably a one-liner to get going :roll: Please share if you get working!

I've rolled my project over to Ogre 1.10 for now, so stopped poking at it for the time being.
JamesAMD
Gnoblar
Posts: 3
Joined: Sat Sep 03, 2016 4:57 pm

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by JamesAMD »

Thanks guys for your fast replies !
So I did what Herb did and Nsight complained about trying to render without a shader program and crashed, so I did:

Code: Select all

mPSOCache->clearState();
mPSOCache->setRenderTarget(vp->getTarget());

mPSOCache->setMacroblock(macroblock);
mPSOCache->setBlendblock(blendblock);
mPSOCache->setVertexShader(const_cast<Ogre::GpuProgramPtr&>(mPass->getVertexProgram()));
mPSOCache->setPixelShader(const_cast<Ogre::GpuProgramPtr&>(mPass->getFragmentProgram()));
Then I tried running again.
This time Nsight doesn't crash but apparently the ProjectionMatrix uniform is filled with 0.0f ?

Code: Select all

mPass->getVertexProgramParameters()->setNamedConstant("ProjectionMatrix", projMatrix);
Is this line not supposed to work ? Do you guys have any thoughts ?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1279
Contact:

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by dark_sylinc »

Mmm.... I can think that maybe this isn't getting called:

Code: Select all

mRenderSystem->bindGpuProgramParameters( GPT_VERTEX_PROGRAM,
                                                     pass->getVertexProgramParameters(), GPV_ALL );
That "flushes" our CPU copy of the parameters into the shader (must be called after the shader has been bound). You can use HlmsLowLevel::executeCommand's code for reference.
Post Reply