Can a shader be applied to a RTT ?
Posted: Wed Jun 16, 2010 10:53 am
For a certain project I'm making I wanted to have hardware accelerated blurring (and other effects) using shaders.
I have an ITexture *Bitmap::Surface.
The problem is that the texture gets drawn but not it's blurred.
hblurpass, vblurpass are classes with a render() method that renders a quad.
The Bitmap::blur() method goes something like (i don't have the code right now):
I have an ITexture *Bitmap::Surface.
The problem is that the texture gets drawn but not it's blurred.
hblurpass, vblurpass are classes with a render() method that renders a quad.
Code: Select all
hblurpass->material.setMaterialType((video::E_MATERIAL_TYPE)gpu->addHighLevelShaderMaterial(0, 0, video::EVST_VS_1_1, "hblurpass.hlsl", "main"));
vblurpass->material.setMaterialType((video::E_MATERIAL_TYPE)gpu->addHighLevelShaderMaterial(0, 0, video::EVST_VS_1_1, "vblurpass.hlsl", "main"));
Code: Select all
void Bitmap::blur()
{
// set perspective correction, the rest of the s**t... then
driver->beginScene();
driver->setRenderTarget(this->Surface);
driver->draw2DImage(mytexture); //texture gets drawn
hblurpass->render();
vblurpass->render();
driver->setRenderTarget(0);
driver->endScene();
}