本文整理汇总了C++中MaterialManager::fillGpuProgramsToPass方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialManager::fillGpuProgramsToPass方法的具体用法?C++ MaterialManager::fillGpuProgramsToPass怎么用?C++ MaterialManager::fillGpuProgramsToPass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaterialManager
的用法示例。
在下文中一共展示了MaterialManager::fillGpuProgramsToPass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _createMaterials
//.........这里部分代码省略.........
else
FragmentProgramData +=
Ogre::String(
"void main_fp(\n") +
// OUT
"out float4 oColor : COLOR)\n" +
"{\n" +
"oColor = float4(float3(" + GB[NumberOfDepthChannels] + ") * 0.1, 1);\n"+
"}\n";
}
break;
case MaterialManager::SM_GLSL:
{}
break;
}
// Build our material
mMaterials[0] = Ogre::MaterialManager::getSingleton().
create(_def_GodRays_Material_Name,
HYDRAX_RESOURCE_GROUP);
Ogre::Pass *GR_Technique0_Pass0 = mMaterials[0]->getTechnique(0)->getPass(0);
GR_Technique0_Pass0->setLightingEnabled(false);
GR_Technique0_Pass0->setCullingMode(Ogre::CULL_NONE);
GR_Technique0_Pass0->setDepthWriteEnabled(false);
GR_Technique0_Pass0->setDepthCheckEnabled(mObjectsIntersections);
GR_Technique0_Pass0->setSceneBlending(Ogre::SBT_ADD);
GpuProgramsData[0] = VertexProgramData; GpuProgramsData[1] = FragmentProgramData;
GpuProgramNames[0] = _def_GodRays_Shader_VP_Name; GpuProgramNames[1] = _def_GodRays_Shader_FP_Name;
mMaterialManager->fillGpuProgramsToPass(GR_Technique0_Pass0, GpuProgramNames, mHydrax->getShaderMode(), EntryPoints, GpuProgramsData);
VP_Parameters = GR_Technique0_Pass0->getVertexProgramParameters();
FP_Parameters = GR_Technique0_Pass0->getFragmentProgramParameters();
VP_Parameters->setNamedAutoConstant("uWorldViewProj", Ogre::GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
if (!mObjectsIntersections)
{
return;
}
Ogre::Matrix4 TexViewProj =
PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE *
mProjectorCamera->getProjectionMatrixWithRSDepth() *
mProjectorCamera->getViewMatrix();
VP_Parameters->setNamedAutoConstant("uWorld", Ogre::GpuProgramParameters::ACT_WORLD_MATRIX);
VP_Parameters->setNamedConstant("uTexViewProj", TexViewProj);
FP_Parameters->setNamedConstant("uLightPosition", mProjectorSN->getPosition());
FP_Parameters->setNamedConstant("uLightFarClipDistance", mProjectorCamera->getFarClipDistance());
GR_Technique0_Pass0->createTextureUnitState(_def_GodRays_Depth_Map)->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
GR_Technique0_Pass0->getTextureUnitState(0)->setTextureName(_def_GodRays_Depth_Map);
// Depth material
VertexProgramData = "";
FragmentProgramData = "";
// Vertex program