材质脚本

material screen
{
    technique
    {
        pass
        {
            texture_unit
            {
                texture blueScreen.jpg
            }

            texture_unit
            {
                texture screen
            }
        }
    }
}
blueScreen.jpg必须是blank white的图像,因为多重纹理混合默认是modulate。。。
texture screen就是在程序里面动态创建的二维图像。。
    Ogre::TexturePtr screenTex = Ogre::TextureManager::getSingleton().createManual("screen", 
        Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
        Ogre::TEX_TYPE_2D,
        640, 480,0, Ogre::PF_R8G8B8A8,
        Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE);

    m_pixelBuffer = screenTex->getBuffer();

然后取得screen动态纹理的buffer,将内容写入该buffer后就可以渲染出来。。

 
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2021-12-18
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2021-07-23
猜你喜欢
  • 2021-08-29
  • 2021-11-09
  • 2021-08-26
  • 2021-11-06
  • 2022-12-23
  • 2021-11-07
相关资源
相似解决方案