本文整理汇总了C++中GpuProgramParametersSharedPtr::getNamedRealConstantEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ GpuProgramParametersSharedPtr::getNamedRealConstantEntry方法的具体用法?C++ GpuProgramParametersSharedPtr::getNamedRealConstantEntry怎么用?C++ GpuProgramParametersSharedPtr::getNamedRealConstantEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GpuProgramParametersSharedPtr
的用法示例。
在下文中一共展示了GpuProgramParametersSharedPtr::getNamedRealConstantEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _init
void _init(void)
{
CompositorPtr compositor = CompositorManager::getSingleton().create(
_theType(), ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
CompositionTechnique *t;
CompositionTechnique::TextureDefinition *td;
CompositionTargetPass *tp;
CompositionPass *pass;
t = compositor->createTechnique();
td = t->createTextureDefinition("scene");
td->width.viewport = 1;
td->height.viewport = 1;
td->format = PF_X8R8G8B8;
td = t->createTextureDefinition("blur0");
td->width.viewport = 0.5;
td->height.viewport = 0.5;
td->format = PF_X8R8G8B8;
td = t->createTextureDefinition("blur1");
td->width.viewport = 0.5;
td->height.viewport = 0.5;
td->format = PF_X8R8G8B8;
tp = t->createTargetPass();
tp->setInputMode(CompositionTargetPass::IM_PREVIOUS);
tp->setOutputName("scene");
tp = t->createTargetPass();
tp->setInputMode(CompositionTargetPass::IM_NONE);
tp->setOutputName("blur0");
pass = tp->createPass();
pass->setType(CompositionPass::PT_RENDERQUAD);
pass->setMaterialName("PostFilters/Floodlighting/DownSample");
pass->setInput(0, "scene");
tp = t->createTargetPass();
tp->setInputMode(CompositionTargetPass::IM_NONE);
tp->setOutputName("blur1");
pass = tp->createPass();
pass->setType(CompositionPass::PT_RENDERQUAD);
pass->setMaterialName("PostFilters/Floodlighting/BlurHorizontal");
pass->setInput(0, "blur0");
tp = t->createTargetPass();
tp->setInputMode(CompositionTargetPass::IM_NONE);
tp->setOutputName("blur1");
pass = tp->createPass();
pass->setType(CompositionPass::PT_RENDERQUAD);
pass->setMaterialName("PostFilters/Floodlighting/BlurVertical");
pass->setInput(0, "blur0");
tp = t->getOutputTargetPass();
tp->setInputMode(CompositionTargetPass::IM_NONE);
pass = tp->createPass();
pass->setType(CompositionPass::PT_RENDERQUAD);
pass->setMaterialName("PostFilters/Floodlighting/Blend");
pass->setInput(0, "scene");
pass->setInput(1, "blur1");
pass->setIdentifier(0xDEADBADE);
mBlurAmount = 0.2f;
mShineAmount = 0.3f;
// receive default parameters from material script
if (!pass->getMaterial().isNull())
{
GpuProgramParametersSharedPtr parameters = pass->getMaterial()->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
#if OGRE_VERSION >= 0x010300
const GpuConstantDefinition* def;
def = parameters->_findNamedConstantDefinition("blur_amount");
if (def)
parameters->_readRawConstants(def->physicalIndex, 1, &mBlurAmount);
def = parameters->_findNamedConstantDefinition("shine_amount");
if (def)
parameters->_readRawConstants(def->physicalIndex, 1, &mShineAmount);
#else
GpuProgramParameters::RealConstantEntry* entry;
entry = parameters->getNamedRealConstantEntry("blur_amount");
if (entry && entry->isSet)
mBlurAmount = entry->val[0];
entry = parameters->getNamedRealConstantEntry("shine_amount");
if (entry && entry->isSet)
mShineAmount = entry->val[0];
#endif
}
}