SceneManager manualRender GPU auto params

Problems building or running the engine, queries about how to use features etc.
Post Reply
cloud
Gremlin
Posts: 196
Joined: Tue Aug 08, 2006 6:45 pm
x 14

SceneManager manualRender GPU auto params

Post by cloud »

hi, I've got code like this

Code: Select all

        Ogre::RenderOperation ro;
        mRectangle->getRenderOperation(ro);
        sm->manualRender(&ro,
                         pass,
                         vp,
                         world,
                         view,
                         proj,
                         false);
pass contains gpu programs and those programs have things like

param_named_auto g_inverse_projection_matrix inverse_projection_matrix

but that matrix isn't getting filled it remains the Identity (note my projection matrix != Identity)

I looked at the code,
I noticed that sm->_markGpuParamsDirty(Ogre::GPV_ALL);
might help, tried that and found no happiness.

I can get around this by making by using param_named and manually setting the matices I need. But this is an ugly approach, so anyone know how to get the rs to set the auto params automagically?

many thanks
rpgplayerrobin
Gnoll
Posts: 620
Joined: Wed Mar 18, 2009 3:03 am
x 355

Re: SceneManager manualRender GPU auto params

Post by rpgplayerrobin »

I encountered a similar thing a while ago, though that used passes and render systems.

This code forced the variables to be filled to the shaders.
Maybe this code can help you somehow anyway:

Code: Select all

Ogre::uint16 tmpGpuParamsDirty = (uint16)GPV_ALL;
if (tmpPass->hasVertexProgram())
	mRenderSystem->bindGpuProgramParameters(GPT_VERTEX_PROGRAM, tmpPass->getVertexProgramParameters(), tmpGpuParamsDirty);

if (tmpPass->hasGeometryProgram())
	mRenderSystem->bindGpuProgramParameters(GPT_GEOMETRY_PROGRAM,tmpPass->getGeometryProgramParameters(), tmpGpuParamsDirty);

if (tmpPass->hasFragmentProgram())
	mRenderSystem->bindGpuProgramParameters(GPT_FRAGMENT_PROGRAM, tmpPass->getFragmentProgramParameters(), tmpGpuParamsDirty);
Post Reply