本文整理汇总了C++中TextureUnitState::setAlphaOperation方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::setAlphaOperation方法的具体用法?C++ TextureUnitState::setAlphaOperation怎么用?C++ TextureUnitState::setAlphaOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureUnitState
的用法示例。
在下文中一共展示了TextureUnitState::setAlphaOperation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupContent
void PlayPen_testProjectSphere::setupContent()
{
mSceneMgr->setAmbientLight(ColourValue::White);
Plane plane;
plane.normal = Vector3::UNIT_Y;
plane.d = 0;
MeshManager::getSingleton().createPlane("Myplane",
TRANSIENT_RESOURCE_GROUP, plane,
4500,4500,10,10,true,1,5,5,Vector3::UNIT_Z);
Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
pPlaneEnt->setMaterialName("Examples/GrassFloor");
pPlaneEnt->setCastShadows(false);
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
mProjectionSphere = new Sphere(Vector3(0, 2000, 0), 1500.0);
ManualObject* debugSphere = mSceneMgr->createManualObject("debugSphere");
debugSphere->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_STRIP);
for (int i = 0; i <= 20; ++i)
{
Vector3 basePos(mProjectionSphere->getRadius(), 0, 0);
Quaternion quat;
quat.FromAngleAxis(Radian(((float)i/(float)20)*Math::TWO_PI), Vector3::UNIT_Y);
basePos = quat * basePos;
debugSphere->position(basePos);
}
for (int i = 0; i <= 20; ++i)
{
Vector3 basePos(mProjectionSphere->getRadius(), 0, 0);
Quaternion quat;
quat.FromAngleAxis(Radian(((float)i/(float)20)*Math::TWO_PI), Vector3::UNIT_Z);
basePos = quat * basePos;
debugSphere->position(basePos);
}
debugSphere->end();
mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,2000,0))->attachObject(debugSphere);
MaterialPtr mat = MaterialManager::getSingleton().create("scissormat",
TRANSIENT_RESOURCE_GROUP);
Pass* p = mat->getTechnique(0)->getPass(0);
p->setDepthWriteEnabled(false);
p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
TextureUnitState* t = p->createTextureUnitState();
t->setColourOperationEx(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT,
ColourValue::Red);
t->setAlphaOperation(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT, 0.5f);
mScissorRect = mSceneMgr->createManualObject("mScissorRect");
mScissorRect->setUseIdentityProjection(true);
mScissorRect->setUseIdentityView(true);
AxisAlignedBox aabb;
aabb.setInfinite();
mScissorRect->setBoundingBox(aabb);
mScissorRect->begin(mat->getName());
mScissorRect->position(Vector3::ZERO);
mScissorRect->position(Vector3::ZERO);
mScissorRect->position(Vector3::ZERO);
mScissorRect->quad(0, 1, 2, 3);
mScissorRect->end();
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(mScissorRect);
mCamera->setPosition(0,3000,5000);
mCamera->lookAt(mProjectionSphere->getCenter());
}