Page 2 of 2

Re: [2.1] Easier way to communicate with hlms shader?

Posted: Tue Feb 23, 2021 8:09 pm
by dark_sylinc
Lax wrote: Tue Feb 23, 2021 1:48 pm @dark_sylinc: Would It be possible, that you add the '&' reference? It will not harm the pbs implementation and make it possible to use meta listeners!
A bit of RTFM here:
the return value is the new location of passBufferPtr. Thus doing:

Code: Select all

while( itor != end )
{
passBuffPtr = itor->preparePassBuffer( shadowNode, casterPass, dualParaboloid,sceneManager, passBufferPtr );
++itor;
}
return passBuffPtr;
Should do it

Re: [2.1] Easier way to communicate with hlms shader?

Posted: Wed Feb 24, 2021 6:11 pm
by Lax
ok thanks. I found a similiar solution.

I have another question:
I know add:

Code: Select all

Ogre::Archive* archiveFog = archiveManager.load(dataFolder + "Hlms/Fog/Any", "FileSystem", true);
archivePbsLibraryFolders.push_back(archiveFog);
Fog data to pbs, if fog is enabled. But now when I disable fog via:

Code: Select all

this->gameObjectPtr->getSceneManager()->setFog(Ogre::FOG_NONE);
The whole scene will become black.

Is it possible to add/remove custom shader from pbs at runtime?
I already tried:

Code: Select all

hlmsPbs->reloadFrom(archivePbs, &archivePbsLibraryFolders);
But that did not work and the scene started to flicker.

Best Regards
Lax

Re: [2.1] Easier way to communicate with hlms shader?

Posted: Sun Mar 07, 2021 10:20 am
by Lax
Hi,

I digged deeper in that topic. When I deactivate fog, the functions

Code: Select all

getPassBufferSize
and

Code: Select all

preparePassBuffer
, but of course, because when Fog is set to 'NONE', there is no listener, so the returned size in

Code: Select all

getPassBufferSize
is 0 and in

Code: Select all

preparePassBuffer
the

Code: Select all

passBufferPtr
is of course not incremented, this causes the black scene/flickering etc. So the question is: How can shader code be deactivated again?

Best Regards
Lax