本文整理汇总了C++中GeometryPtr::Execute方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryPtr::Execute方法的具体用法?C++ GeometryPtr::Execute怎么用?C++ GeometryPtr::Execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryPtr
的用法示例。
在下文中一共展示了GeometryPtr::Execute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawScene
void SDFShadowDemo::DrawScene()
{
m_pRender->pImmPipeline->ClearBuffers(Colors::LightSteelBlue);
//for (auto i = 0; i < m_vGeoms.size(); ++i)
//{
// auto pData = m_pRender->pImmPipeline->MapResource(m_constantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0);
// auto pBuffer = (CBufferType*)pData.pData;
// pBuffer->mat = m_vMats[i] * m_worldMat * m_viewMat * m_projMat;
// m_pRender->pImmPipeline->UnMapResource(m_constantBuffer, 0);
// m_pRender->pImmPipeline->ApplyPipelineResources();
// m_vGeoms[i]->Execute(m_pRender->pImmPipeline);
//}
ShaderStageStateDX11 vsState;
vsState.ShaderProgram.SetState(m_vsID);
m_pRender->pImmPipeline->VertexShaderStage.DesiredState = vsState;
auto pData = m_pRender->pImmPipeline->MapResource(m_constantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0);
auto pBuffer = (CBufferType*)pData.pData;
pBuffer->matWorld = m_worldMat;
pBuffer->matViewProj = m_viewMat * m_projMat;
pBuffer->matViewProjInverse = (m_viewMat * m_projMat).Inverse();
pBuffer->screenParams = Vector4f(static_cast<f32>(mClientWidth), static_cast<f32>(mClientHeight), 0.0f, 0.0f);
pBuffer->SDFParams = m_sdfParams;
pBuffer->SDFOrigin = m_sdfOrigin;
pBuffer->cameraPos = m_cameraPos;
m_pRender->pImmPipeline->UnMapResource(m_constantBuffer, 0);
auto resource = m_pRender->GetResourceByIndex(m_constantBuffer->m_iResource);
ShaderStageStateDX11 psState;
psState.ShaderProgram.SetState(m_psID);
psState.SamplerStates.SetState(0, m_pRender->GetSamplerState(m_samplerID).Get());
psState.ShaderResourceViews.SetState(0, m_pRender->GetShaderResourceViewByIndex(m_SDFTex3D->m_iResourceSRV).GetSRV());
psState.ConstantBuffers.SetState(0, (ID3D11Buffer*)resource->GetResource());
m_pRender->pImmPipeline->PixelShaderStage.DesiredState = psState;
m_pRender->pImmPipeline->ApplyPipelineResources();
m_pQuad->Execute(m_pRender->pImmPipeline);
m_pRender->Present(MainWnd(), 0);
}