游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3121|回复: 0

使用compositor通道中的纹理作为一widget控件的材质纹理单

[复制链接]

1

主题

1

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2011-12-11 21:45:00 | 显示全部楼层 |阅读模式
我使用的事Ogre1.7.5,里面的控件使用的是sdktrayer做的,我想把一个合成器通道中的纹理用于一个widget控件的材质单元。里面的代码都是完全按照compositor Demo里面的代码照搬过来的,但是那个控件的材质背景动态变化的效果出不来,运行时报错如下:
OGRE EXCEPTION(1:InvalidStateException): A pass that wishes to reference a compositor texutre attempted to render in a pipeline without a compositor in SceneManager::_setPass at ..\..\..\..\OgreMain\src\OgreSceneManager.cpp (line 1159)

Ogre::CompositorManager::getSingleton().addCompositor(vp,compositorName,addposition);
Ogre::CompositorManager::getSingleton().setCompositorEnabled(vp,compositorName,false);

m_DebugTextureTUS=debugRTTContainer->getChild("DebugRTTPanel/PictureFrame")->getMaterial()->getBestTechnique()->getPass(0)->getTextureUnitState(0);
m_DebugTextureTUS->setContentType(Ogre::TextureUnitState::CONTENT_COMPOSITOR);
if (parts.size()==2)
        {
                m_DebugTextureTUS->setCompositorReference(parts[0],parts[1]);
        }
        else
        {
                m_DebugTextureTUS->setCompositorReference(parts[0],parts[1]),Ogre::StringConverter::parseUnsignedInt(parts[2]);
        }



里面的脚本使用的是Demo里面自带的example.compositor脚本
求高手指教那里出错
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-6-9 04:57

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表