MCPcopy Create free account
hub / github.com/assimp/assimp / RenderFullScene

Method RenderFullScene

tools/assimp_view/Display.cpp:1709–1824  ·  view source on GitHub ↗

------------------------------------------------------------------------------- Render the full scene, all nodes

Source from the content-addressed store, hash-verified

1707//-------------------------------------------------------------------------------
1708// Render the full scene, all nodes
1709int CDisplay::RenderFullScene()
1710{
1711 // reset the color index used for drawing normals
1712 g_iCurrentColor = 0;
1713
1714 aiMatrix4x4 pcProj;
1715 GetProjectionMatrix(pcProj);
1716
1717 vPos = GetCameraMatrix(mViewProjection);
1718 mViewProjection = mViewProjection * pcProj;
1719
1720 // setup wireframe/solid rendering mode
1721 if (g_sOptions.eDrawMode == RenderOptions::WIREFRAME)
1722 g_piDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
1723 else g_piDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
1724
1725 if (g_sOptions.bCulling)
1726 g_piDevice->SetRenderState(D3DRS_CULLMODE,D3DCULL_CCW);
1727 else g_piDevice->SetRenderState(D3DRS_CULLMODE,D3DCULL_NONE);
1728
1729 // for high-quality mode, enable anisotropic texture filtering
1730 if (g_sOptions.bLowQuality) {
1731 for (DWORD d = 0; d < 8;++d) {
1732 g_piDevice->SetSamplerState(d,D3DSAMP_MAGFILTER,D3DTEXF_LINEAR);
1733 g_piDevice->SetSamplerState(d,D3DSAMP_MINFILTER,D3DTEXF_LINEAR);
1734 g_piDevice->SetSamplerState(d,D3DSAMP_MIPFILTER,D3DTEXF_LINEAR);
1735 }
1736 }
1737 else {
1738 for (DWORD d = 0; d < 8;++d) {
1739 g_piDevice->SetSamplerState(d,D3DSAMP_MAGFILTER,D3DTEXF_ANISOTROPIC);
1740 g_piDevice->SetSamplerState(d,D3DSAMP_MINFILTER,D3DTEXF_ANISOTROPIC);
1741 g_piDevice->SetSamplerState(d,D3DSAMP_MIPFILTER,D3DTEXF_LINEAR);
1742
1743 g_piDevice->SetSamplerState(d,D3DSAMP_MAXANISOTROPY,g_sCaps.MaxAnisotropy);
1744 }
1745 }
1746
1747 // draw the scene background (clear and texture 2d)
1748 CBackgroundPainter::Instance().OnPreRender();
1749
1750 // setup the stereo view if necessary
1751 if (g_sOptions.bStereoView)
1752 SetupStereoView();
1753
1754
1755 // draw all opaque objects in the scene
1756 aiMatrix4x4 m;
1757 if (nullptr != g_pcAsset && nullptr != g_pcAsset->pcScene->mRootNode)
1758 {
1759 HandleInput();
1760 m = g_mWorld * g_mWorldRotate;
1761 RenderNode(g_pcAsset->pcScene->mRootNode,m,false);
1762 }
1763
1764 // if a cube texture is loaded as background image, the user
1765 // should be able to rotate it even if no asset is loaded
1766 HandleInputEmptyScene();

Callers

nothing calls this directly

Calls 8

GetProjectionMatrixFunction · 0.85
GetCameraMatrixFunction · 0.85
InstanceClass · 0.85
OnPreRenderMethod · 0.80
OnPostRenderMethod · 0.80
SetVectorMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected