| 812 | |
| 813 | |
| 814 | void ViewerSettingsPlugin::drawRenderOptions_() |
| 815 | { |
| 816 | auto& style = ImGui::GetStyle(); |
| 817 | ImGui::PushStyleVar( ImGuiStyleVar_ItemSpacing, { style.ItemSpacing.x, style.ItemSpacing.y * 1.5f } ); |
| 818 | |
| 819 | if ( viewer->isAlphaSortAvailable() ) |
| 820 | { |
| 821 | bool alphaSortBackUp = viewer->isAlphaSortEnabled(); |
| 822 | bool alphaBoxVal = alphaSortBackUp; |
| 823 | UI::checkbox( _tr( "Alpha Sort" ), &alphaBoxVal ); |
| 824 | if ( alphaBoxVal != alphaSortBackUp ) |
| 825 | viewer->enableAlphaSort( alphaBoxVal ); |
| 826 | } |
| 827 | |
| 828 | ImGui::PushItemWidth( 100.0f * UI::scale() ); |
| 829 | if ( viewer->isAlphaSortEnabled() ) |
| 830 | { |
| 831 | UI::readOnlyValue<NoUnit>( _tr( "Depth Peeling Passes" ), viewer->getDepthPeelNumPasses() ); |
| 832 | } |
| 833 | else |
| 834 | { |
| 835 | int dpNumPasses = viewer->getDepthPeelNumPasses(); |
| 836 | UI::input<NoUnit>( _tr( "Depth Peeling Passes" ), dpNumPasses, 0, 64 ); |
| 837 | viewer->setDepthPeelNumPasses( dpNumPasses ); |
| 838 | } |
| 839 | ImGui::PopItemWidth(); |
| 840 | |
| 841 | if ( viewer->isGLInitialized() ) |
| 842 | { |
| 843 | if ( maxSamples_ > 1 ) |
| 844 | { |
| 845 | auto backUpSamples = viewer->getRequestedMSAA(); |
| 846 | auto newSamples = backUpSamples; |
| 847 | ImGui::Text( "%s", _tr( "Multisample anti-aliasing (MSAA):" ) ); |
| 848 | UI::setTooltipIfHovered( _tr( "The number of samples per pixel: more samples - better render quality but worse performance." ) ); |
| 849 | int counter = 0; |
| 850 | for ( int i = 0; i <= maxSamples_; i <<= 1 ) |
| 851 | { |
| 852 | #ifdef __EMSCRIPTEN__ |
| 853 | if ( !viewer->isSceneTextureEnabled() && i == 2 ) |
| 854 | continue; // only OFF and x4 are available for main framebuffer in web |
| 855 | #endif |
| 856 | if ( i == 0 ) |
| 857 | { |
| 858 | UI::radioButton( _tr( "Off" ), &newSamples, i ); |
| 859 | ++i; |
| 860 | } |
| 861 | else |
| 862 | { |
| 863 | std::string label = 'x' + std::to_string( i ); |
| 864 | UI::radioButton( label.c_str(), &newSamples, i ); |
| 865 | } |
| 866 | if ( i << 1 <= maxSamples_ ) |
| 867 | ImGui::SameLine( ( ( ++counter ) * 70.f + style.WindowPadding.x ) * UI::scale() ); |
| 868 | } |
| 869 | if ( newSamples != backUpSamples ) |
| 870 | viewer->requestChangeMSAA( newSamples ); |
| 871 | int initMSAA = storedSamples_; |
nothing calls this directly
no test coverage detected