zoukankan      html  css  js  c++  java
  • ogre渲染到动态纹理

    材质脚本

    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后就可以渲染出来。。

     
     
  • 相关阅读:
    实验报告2
    实验三 网络欺骗技术
    实验3
    心理魔术
    实验报告
    实验4
    实验5
    实验四恶意代码
    网络对抗技术 实验一
    实验二
  • 原文地址:https://www.cnblogs.com/kex1n/p/2704162.html
Copyright © 2011-2022 走看看