本文整理汇总了C++中KX_LightObject::HasShadowBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ KX_LightObject::HasShadowBuffer方法的具体用法?C++ KX_LightObject::HasShadowBuffer怎么用?C++ KX_LightObject::HasShadowBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KX_LightObject
的用法示例。
在下文中一共展示了KX_LightObject::HasShadowBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderShadowBuffers
void KX_KetsjiEngine::RenderShadowBuffers(KX_Scene *scene)
{
CListValue *lightlist = scene->GetLightList();
int i, drawmode;
m_rendertools->SetAuxilaryClientInfo(scene);
for(i=0; i<lightlist->GetCount(); i++) {
KX_GameObject *gameobj = (KX_GameObject*)lightlist->GetValue(i);
KX_LightObject *light = (KX_LightObject*)gameobj;
light->Update();
if(m_drawingmode == RAS_IRasterizer::KX_TEXTURED && light->HasShadowBuffer()) {
/* make temporary camera */
RAS_CameraData camdata = RAS_CameraData();
KX_Camera *cam = new KX_Camera(scene, scene->m_callbacks, camdata, true, true);
cam->SetName("__shadow__cam__");
MT_Transform camtrans;
/* switch drawmode for speed */
drawmode = m_rasterizer->GetDrawingMode();
m_rasterizer->SetDrawingMode(RAS_IRasterizer::KX_SHADOW);
/* binds framebuffer object, sets up camera .. */
light->BindShadowBuffer(m_rasterizer, cam, camtrans);
/* update scene */
scene->CalculateVisibleMeshes(m_rasterizer, cam, light->GetShadowLayer());
/* render */
m_rasterizer->ClearDepthBuffer();
scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools);
/* unbind framebuffer object, restore drawmode, free camera */
light->UnbindShadowBuffer(m_rasterizer);
m_rasterizer->SetDrawingMode(drawmode);
cam->Release();
}
}
}