本文整理汇总了C++中Time::GetDeltaSeconds方法的典型用法代码示例。如果您正苦于以下问题:C++ Time::GetDeltaSeconds方法的具体用法?C++ Time::GetDeltaSeconds怎么用?C++ Time::GetDeltaSeconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time::GetDeltaSeconds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetScene
ObjectPtr<ITexture2D> DX11DeferredRenderer::Draw(const Time& time, unsigned int width, unsigned int height){
graphics_.PushEvent(L"Frame");
auto& context = DX11Graphics::GetInstance().GetContext();
// Context setup - The depth and the blend state should be defined per render section, however we support only opaque geometry without any fancy stuffs
context.PushPipelineState(DX11PipelineState::kDefault);
// Draws only if there's a camera
ObjectPtr<ITexture2D> output = nullptr;
auto main_camera = GetScene().GetMainCamera();
if (main_camera){
FrameInfo frame_info;
frame_info.scene = &GetScene();
frame_info.aspect_ratio = static_cast<float>(width) / static_cast<float>(height);
frame_info.width = width;
frame_info.height = height;
frame_info.view_matrix = main_camera->GetViewTransform().matrix();
frame_info.view_proj_matrix = GetViewProjectionMatrix(frame_info.aspect_ratio); // This matrix must be the "real" view projection matrix, regardless of whether the camera is locked or not.
frame_info.time_delta = time.GetDeltaSeconds();
frame_info.enable_global_illumination = enable_global_illumination_;
if (!lock_camera_) {
frame_info.camera = main_camera;
main_camera->Clone(*locked_camera_);
}
else {
frame_info.camera = locked_camera_;
}
DrawGBuffer(frame_info); // Scene -> GBuffer
if (enable_global_illumination_) {
voxelization_->Update(frame_info); // Dynamic voxelization of the scene
}
output = ComputeLighting(frame_info); // Scene, GBuffer, DepthBuffer -> LightBuffer
}
// Cleanup
context.PopPipelineState();
immediate_context_->ClearState();
// Done
graphics_.PopEvent();
return output;
}