Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Source/Falcor/Core/Testbed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ void Testbed::loadScene(const std::filesystem::path& path, SceneBuilder::Flags b
{
mpScene = SceneBuilder(mpDevice, path, Settings(), buildFlags).getScene();

// Adjust the camera aspect ratio.
if (mpScene && mpTargetFBO)
mpScene->setCameraAspectRatio(mpTargetFBO->getWidth() / float(mpTargetFBO->getHeight()));

if (mpRenderGraph)
mpRenderGraph->setScene(mpScene);
}
Expand All @@ -166,6 +170,10 @@ void Testbed::loadSceneFromString(const std::string& scene, const std::string ex
{
mpScene = SceneBuilder(mpDevice, scene.data(), scene.length(), extension, Settings(), buildFlags).getScene();

// Adjust the camera aspect ratio.
if (mpScene && mpTargetFBO)
mpScene->setCameraAspectRatio(mpTargetFBO->getWidth() / float(mpTargetFBO->getHeight()));

if (mpRenderGraph)
mpRenderGraph->setScene(mpScene);
}
Expand Down