We can use the compositor, material, and fragment shader from the last example. Only the application itself must be modified:
We can't directly interact with the material of the quad that is rendered because our application doesn't know about the quad. The only way to interact with a compositor rendering process is through listeners. Ogre 3D provided an interface for the compositor listener. We can use this to create a new listener:
class CompositorListener1 : public Ogre::CompositorInstance::Listener { public:
Override this method, which is called when the material is set up:
void notifyMaterialSetup (uint32 pass_id, MaterialPtr &mat) {
Use the given pointer to the material to change the
numpixels
parameter to 125:mat->getBestTechnique()->getPass(pass_id)->getFragmentProgramParameters()->setNamedConstant("numpixels",125.0f); }
Add the following code to get the compositor instance after the code we added to enable...