MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / RenderHUD

Method RenderHUD

BakingLab/BakingLab.cpp:798–909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

796}
797
798void BakingLab::RenderHUD(const Timer& timer, float groundTruthProgress, float bakeProgress,
799 uint64 groundTruthSampleCount)
800{
801 PIXEvent event(L"HUD Pass");
802
803 ID3D11DeviceContext* context = deviceManager.ImmediateContext();
804 spriteRenderer.Begin(context, SpriteRenderer::Point);
805
806 Float4x4 transform = Float4x4::TranslationMatrix(Float3(25.0f, 25.0f, 0.0f));
807 wstring fpsText(L"FPS: ");
808 fpsText += ToString(fps) + L" (" + ToString(1000.0f / fps) + L"ms)";
809 spriteRenderer.RenderText(font, fpsText.c_str(), transform, XMFLOAT4(1, 1, 0, 1));
810
811 transform._42 += 25.0f;
812 wstring vsyncText(L"VSYNC (V): ");
813 vsyncText += deviceManager.VSYNCEnabled() ? L"Enabled" : L"Disabled";
814 spriteRenderer.RenderText(font, vsyncText.c_str(), transform, XMFLOAT4(1, 1, 0, 1));
815
816 Profiler::GlobalProfiler.EndFrame(spriteRenderer, font);
817
818 if(groundTruthProgress < 1.0f || bakeProgress < 1.0f)
819 {
820 std::wstring progressText;
821 if(groundTruthProgress < 1.0f)
822 {
823 float percent = Round(groundTruthProgress * 10000.0f);
824 percent /= 100.0f;
825 progressText = L"Rendering ground truth (" + ToString(percent) + L"%)";
826 if(groundTruthSampleCount > 0)
827 {
828 const uint64 currIdx = GTSampleRateBufferIdx++;
829 const uint64 bufferSize = ArraySize_(GTSampleRateBuffer);
830 GTSampleRateBuffer[currIdx % bufferSize] = groundTruthSampleCount / timer.DeltaMicrosecondsF();
831
832 float samplesPerMS = 0.0f;
833 for(uint64 i = 0; i < bufferSize; ++i)
834 samplesPerMS += GTSampleRateBuffer[i];
835 samplesPerMS /= float(bufferSize);
836 samplesPerMS = Round(samplesPerMS * 1000.0f);
837
838 progressText += L" [" + ToString(samplesPerMS) + L" samp/sec]";
839 }
840 }
841 else if(bakeProgress < 1.0f)
842 {
843 float percent = Round(bakeProgress * 10000.0f);
844 percent /= 100.0f;
845 progressText = L"Baking light maps (" + ToString(percent) + L"%)";
846 }
847
848 transform._41 = 35.0f;
849 transform._42 = deviceManager.BackBufferHeight() - 60.0f;
850 spriteRenderer.RenderText(font, progressText.c_str(), transform);
851 }
852
853 if(AppSettings::EnableLuminancePicker && mouseState.IsOverWindow)
854 {
855 const uint8* texels = nullptr;

Callers

nothing calls this directly

Calls 15

Float3Class · 0.85
ToStringFunction · 0.85
RoundFunction · 0.85
ComputeLuminanceFunction · 0.85
SunIlluminanceFunction · 0.85
MaxFunction · 0.85
ImmediateContextMethod · 0.80
BeginMethod · 0.80
VSYNCEnabledMethod · 0.80
EndFrameMethod · 0.80
DeltaMicrosecondsFMethod · 0.80
BackBufferHeightMethod · 0.80

Tested by

no test coverage detected