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

Ogre 2.1 imgui _injectRenderWithPass

Post by IndieGuy11 » Wed Sep 06, 2017 2:49 pm

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!
0 x

paroj
OGRE Team Member
OGRE Team Member
Posts: 567
Joined: Sun Mar 30, 2014 2:51 pm
x 81
Contact:

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by paroj » Wed Sep 06, 2017 10:39 pm

the api docs you reference are outdated, take a look at: https://ogrecave.github.io/ogre/api/2.1/
0 x

IndieGuy11
Halfling
Posts: 50
Joined: Fri May 19, 2017 8:09 pm

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by IndieGuy11 » Wed Sep 06, 2017 11:37 pm

Haha, many thanks! Opps!
0 x

JamesAMD
Gnoblar
Posts: 3
Joined: Sat Sep 03, 2016 4:57 pm

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by JamesAMD » Wed Feb 21, 2018 4:35 pm

Did you manage to get it working ?
Apparently _setHlmsBlendblock, _setHlmsMacroblock, _injectRenderWithPass are all deprecated.
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3698
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 120
Contact:

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by dark_sylinc » Wed Feb 21, 2018 4:59 pm

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.
0 x

User avatar
Herb
Orc
Posts: 412
Joined: Thu Jun 04, 2009 3:21 am
Location: Kalamazoo,MI
x 1

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by Herb » Wed Feb 21, 2018 10:38 pm

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.
0 x

JamesAMD
Gnoblar
Posts: 3
Joined: Sat Sep 03, 2016 4:57 pm

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by JamesAMD » Thu Feb 22, 2018 12:46 pm

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 ?
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3698
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 120
Contact:

Re: Ogre 2.1 imgui _injectRenderWithPass

Post by dark_sylinc » Thu Feb 22, 2018 9:49 pm

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.
0 x

Post Reply