MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / update

Method update

Source/Falcor/Scene/Scene.cpp:1840–1955  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1838 }
1839
1840 IScene::UpdateFlags Scene::update(RenderContext* pRenderContext, double currentTime)
1841 {
1842 mUpdates = IScene::UpdateFlags::None;
1843
1844 // Perform updates that may affect the scene defines.
1845 updateGeometryTypes();
1846 mUpdates |= updateMaterials(false);
1847
1848 // Update scene defines.
1849 // These are currently assumed not to change beyond this point.
1850 updateSceneDefines();
1851 if (mSceneDefines != mPrevSceneDefines)
1852 {
1853 mUpdates |= IScene::UpdateFlags::SceneDefinesChanged;
1854 mPrevSceneDefines = mSceneDefines;
1855 mpSceneBlock = nullptr;
1856 }
1857
1858 // Recreate scene parameter block if scene defines changed, as the defines may affect resource declarations.
1859 // All access to the (new) scene parameter block should be placed after this point.
1860 if (!mpSceneBlock)
1861 {
1862 logDebug("Recreating scene parameter block");
1863 createParameterBlock();
1864 bindParameterBlock();
1865 }
1866
1867 if (mpAnimationController->animate(pRenderContext, currentTime))
1868 {
1869 mUpdates |= IScene::UpdateFlags::SceneGraphChanged;
1870 if (mpAnimationController->hasSkinnedMeshes()) mUpdates |= IScene::UpdateFlags::MeshesChanged;
1871
1872 for (const auto& inst : mGeometryInstanceData)
1873 {
1874 if (mpAnimationController->isMatrixChanged(NodeID{ inst.globalMatrixID }))
1875 {
1876 mUpdates |= IScene::UpdateFlags::GeometryMoved;
1877 }
1878 }
1879
1880 // We might end up setting the flag even if curves haven't changed (if looping is disabled for example).
1881 if (mpAnimationController->hasAnimatedCurveCaches()) mUpdates |= IScene::UpdateFlags::CurvesMoved;
1882 if (mpAnimationController->hasAnimatedMeshCaches()) mUpdates |= IScene::UpdateFlags::MeshesChanged;
1883 }
1884
1885 for (const auto& pGridVolume : mGridVolumes)
1886 {
1887 pGridVolume->updatePlayback(currentTime);
1888 }
1889
1890 mUpdates |= updateSelectedCamera(false);
1891 mUpdates |= updateLights(false);
1892 mUpdates |= updateGridVolumes(false);
1893 mUpdates |= updateEnvMap(false);
1894 mUpdates |= updateGeometry(pRenderContext, false);
1895 mUpdates |= updateSDFGrids(pRenderContext);
1896 pRenderContext->submit();
1897

Callers 14

updateSDFGridsMethod · 0.45
updateSelectedCameraMethod · 0.45
updateMaterialsMethod · 0.45
computeSceneCacheKeyFunction · 0.45
loadAllPluginsMethod · 0.45
frameMethod · 0.45
createProgramVersionMethod · 0.45
createProgramKernelsMethod · 0.45
onFrameRenderMethod · 0.45
CPU_TESTFunction · 0.45
GPU_TESTFunction · 0.45
GPU_TESTFunction · 0.45

Calls 6

logDebugFunction · 0.85
getLightCollectionFunction · 0.85
updatePlaybackMethod · 0.80
animateMethod · 0.45
submitMethod · 0.45
getMemoryUsageInBytesMethod · 0.45

Tested by 5

frameMethod · 0.36
CPU_TESTFunction · 0.36
GPU_TESTFunction · 0.36
GPU_TESTFunction · 0.36
testDiffPBRTDiffuseFunction · 0.36