Ejemplo n.º 1
0
void InitUI()
{
    // Setup default UI state
    // NOTE: All of these are made directly available in the shader constant buffer
    // This is convenient for development purposes.

#pragma region set UIConstants
    gUIConstants.lightingOnly = 0;
    gUIConstants.faceNormals = 0;
    gUIConstants.visualizeLightCount = 0;
    gUIConstants.visualizePerSampleShading = 0;
    gUIConstants.lightCullTechnique = CULL_QUAD_DEFERRED_LIGHTING;
#pragma endregion

    gD3DSettingsDlg.Init(&gDialogResourceManager);

    for (int i = 0; i < HUD_NUM; ++i) {
        gHUD[i].Init(&gDialogResourceManager);
        gHUD[i].SetCallback(OnGUIEvent);
    }

    int width = 200;

#pragma region Generate Hud
    // Generic HUD
    {
        CDXUTDialog* HUD = &gHUD[HUD_GENERIC];
        int y = 0;

        HUD->AddButton(UI_TOGGLEFULLSCREEN, L"Toggle full screen", 0, y, width, 23);
        y += 26;

        // Warp doesn't support DX11 yet
        //HUD->AddButton(UI_TOGGLEWARP, L"Toggle WARP (F3)", 0, y, width, 23, VK_F3);
        //y += 26;

        HUD->AddButton(UI_CHANGEDEVICE, L"Change device (F2)", 0, y, width, 23, VK_F2);
        y += 26;

#pragma region Add MSAA select Combo Box Items
        HUD->AddComboBox(UI_MSAA, 0, y, width, 23, 0, false, &gMSAACombo);
        y += 26;
        gMSAACombo->AddItem(L"No MSAA", ULongToPtr(1));
        gMSAACombo->AddItem(L"2x MSAA", ULongToPtr(2));
        gMSAACombo->AddItem(L"4x MSAA", ULongToPtr(4));
        gMSAACombo->AddItem(L"8x MSAA", ULongToPtr(8));
#pragma endregion

#pragma region Add Scene/mesh select Combo Box items
        HUD->AddComboBox(UI_SELECTEDSCENE, 0, y, width, 23, 0, false, &gSceneSelectCombo);
        y += 26;
		gSceneSelectCombo->AddItem(L"Cube World (AWE)", ULongToPtr(CUBE_WORLD));
        gSceneSelectCombo->AddItem(L"Power Plant", ULongToPtr(POWER_PLANT_SCENE));
        gSceneSelectCombo->AddItem(L"Sponza", ULongToPtr(SPONZA_SCENE));
		gSceneSelectCombo->AddItem(L"Multi Object Scene", ULongToPtr(MULTI_SCENE));
		gSceneSelectCombo->AddItem(L"CUBES", ULongToPtr(CUBES));
#pragma endregion

#pragma region Add Options Checkboxes and sliders
        HUD->AddCheckBox(UI_ANIMATELIGHT, L"Animate Lights", 0, y, width, 23, false, VK_SPACE, false, &gAnimateLightCheck);
        y += 26;

        HUD->AddCheckBox(UI_LIGHTINGONLY, L"Lighting Only", 0, y, width, 23, gUIConstants.lightingOnly != 0);
        y += 26;

        HUD->AddCheckBox(UI_FACENORMALS, L"Face Normals", 0, y, width, 23, gUIConstants.faceNormals != 0);
        y += 26;

        HUD->AddCheckBox(UI_VISUALIZELIGHTCOUNT, L"Visualize Light Count", 0, y, width, 23, gUIConstants.visualizeLightCount != 0);
        y += 26;

        HUD->AddCheckBox(UI_VISUALIZEPERSAMPLESHADING, L"Visualize Shading Freq.", 0, y, width, 23, gUIConstants.visualizePerSampleShading != 0);
        y += 26;

        HUD->AddStatic(UI_LIGHTSTEXT, L"Lights:", 0, y, width, 23);
        y += 26;
        HUD->AddSlider(UI_LIGHTS, 0, y, width, 23, 0, MAX_LIGHTS_POWER, MAX_LIGHTS_POWER, false, &gLightsSlider);
        y += 26;
#pragma endregion

#pragma region Add Lighting method select Combo box items
        HUD->AddComboBox(UI_CULLTECHNIQUE, 0, y, width, 23, 0, false, &gCullTechniqueCombo);
        y += 26;
        gCullTechniqueCombo->AddItem(L"No Cull Forward", ULongToPtr(CULL_FORWARD_NONE));
        gCullTechniqueCombo->AddItem(L"No Cull Pre-Z", ULongToPtr(CULL_FORWARD_PREZ_NONE));
        gCullTechniqueCombo->AddItem(L"No Cull Deferred", ULongToPtr(CULL_DEFERRED_NONE));
        gCullTechniqueCombo->AddItem(L"Quad", ULongToPtr(CULL_QUAD));
        gCullTechniqueCombo->AddItem(L"Quad Deferred Light", ULongToPtr(CULL_QUAD_DEFERRED_LIGHTING));
        gCullTechniqueCombo->AddItem(L"Compute Shader Tile", ULongToPtr(CULL_COMPUTE_SHADER_TILE));
        gCullTechniqueCombo->SetSelectedByData(ULongToPtr(gUIConstants.lightCullTechnique));
#pragma endregion

        HUD->SetSize(width, y);
    }

    // Expert HUD
    {
        CDXUTDialog* HUD = &gHUD[HUD_EXPERT];
        int y = 0;
    
        HUD->SetSize(width, y);

        // Initially hidden
        HUD->SetVisible(false);
    }
#pragma endregion

    UpdateUIState();
}
Ejemplo n.º 2
0
//------------------------------------------------------------------------
// Name: OnChainSelect
// Desc: event handler for select one of chains
//------------------------------------------------------------------------
HRESULT OnChainSelect(int iID)
{
	if(iID >= 0)
	{
		wchar_t str[256];
		cprimitive* chain = manipulator->cube[iID];
		
		g_SampleUI.SetVisible(true);

		swprintf(str,L"You picked chain # %d",iID);
		g_SampleUI.GetStatic( IDC_OBJNAME )->SetText(str);

		g_SampleUI.GetSlider(IDC_WIDTH_SLIDER)->SetValue(chain->fWidth);

		swprintf(str,L"%.2f",chain->fWidth);
		g_SampleUI.GetEditBox( IDC_WIDTH )->SetText(str);

		g_SampleUI.GetSlider(IDC_LENGTH_SLIDER)->SetValue(chain->fLength);

		swprintf(str,L"%.2f",chain->fLength);
		g_SampleUI.GetEditBox( IDC_LENGTH )->SetText(str);

		swprintf(str,L"%.2f",chain->restrictAngleX.x);
		g_SampleUI.GetEditBox( IDC_ANGLE_RESTRICT_XL )->SetText(str);
		swprintf(str,L"%.2f",chain->restrictAngleX.y);
		g_SampleUI.GetEditBox( IDC_ANGLE_RESTRICT_XU )->SetText(str);
		swprintf(str,L"%.2f",chain->restrictAngleY.x);
		g_SampleUI.GetEditBox( IDC_ANGLE_RESTRICT_YL )->SetText(str);
		swprintf(str,L"%.2f",chain->restrictAngleY.y);
		g_SampleUI.GetEditBox( IDC_ANGLE_RESTRICT_YU )->SetText(str);

		swprintf(str,L"%.2f",chain->vOffset.x);
		g_SampleUI.GetEditBox( IDC_OFFSET_X )->SetText(str);
		swprintf(str,L"%.2f",chain->vOffset.y);
		g_SampleUI.GetEditBox( IDC_OFFSET_Y )->SetText(str);
		swprintf(str,L"%.2f",chain->vOffset.z);
		g_SampleUI.GetEditBox( IDC_OFFSET_Z )->SetText(str);

		swprintf(str,L"%.2f",chain->fDisplace);
		g_SampleUI.GetEditBox( IDC_DISPLACE )->SetText(str);
		swprintf(str,L"%.2f",chain->fDirection);
		g_SampleUI.GetEditBox( IDC_DIRECTION )->SetText(str);
		swprintf(str,L"%.2f",chain->fCoefficient);
		g_SampleUI.GetEditBox( IDC_COEFFICIENT )->SetText(str);
		swprintf(str,L"%.2f",chain->fMass);
		g_SampleUI.GetEditBox( IDC_MASS )->SetText(str);

		g_SampleUI.GetCheckBox( IDC_TILT )->SetChecked(chain->bTilt);
		g_SampleUI.GetCheckBox( IDC_PRESSURE )->SetChecked(chain->bPressure);
		g_SampleUI.GetCheckBox( IDC_LASER )->SetChecked(chain->bLaser);


		swprintf(str,L"X: %.2f",chain->vAngle.x);
		g_SampleUI.GetStatic( IDC_STATIC7 )->SetText(str);
		swprintf(str,L"Y: %.2f",chain->vAngle.y);
		g_SampleUI.GetStatic( IDC_STATIC8 )->SetText(str);
	}
	else
	{
		g_SampleUI.SetVisible(false);
	}

	return S_OK;
}
Ejemplo n.º 3
0
//--------------------------------------------------------------------------------------
// Initialize the app 
//--------------------------------------------------------------------------------------
void InitApp()
{
	camera = new CCamera;
	manipulator = new CManipulator;


    g_SettingsDlg.Init( &g_DialogResourceManager );
    g_HUD.Init( &g_DialogResourceManager );
    g_SampleUI.Init( &g_DialogResourceManager );



	//g_HUD
    g_HUD.SetCallback( OnGUIEvent );

    g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 5, 10, 125, 22, VK_F12 );

	//fonts
	g_HUD.SetFont( 1, L"Arial", 20, FW_BOLD );
	g_HUD.SetFont( 2, L"Arial", 16, FW_NORMAL );

	g_HUD.AddEditBox( IDC_NEWFILE, L"testconfig.ini", 150, 10, 120, 30 );
	g_HUD.AddButton( IDC_NEWFILE_BTN, L"New", 280, 15, 60, 20);
	g_HUD.AddEditBox( IDC_LOADFILE, L"testconfig.ini", 150, 40, 120, 30 );
	g_HUD.AddButton( IDC_LOADFILE_BTN, L"Load", 280, 45, 60, 20);
	g_HUD.AddEditBox( IDC_SAVEFILE, L"testconfig.ini", 150, 70, 120, 30 );
	g_HUD.AddButton( IDC_SAVEFILE_BTN, L"Save", 280, 75, 60, 20);

	g_HUD.AddEditBox( IDC_CMD, L"", 5, 5, 300, 30 );
	g_HUD.AddStatic( IDC_STATIC7, L"status", 5, 5, 300, 30 );
	g_HUD.GetStatic( IDC_STATIC7 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_HUD.GetStatic( IDC_STATIC7 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_HUD.GetStatic( IDC_STATIC7 )->GetElement(0)->iFont = 2;

	//g_SampleUI
    g_SampleUI.SetCallback( OnGUIEvent ); int iY = 10;
	g_SampleUI.SetVisible(false);
	
	//fonts
	g_SampleUI.SetFont( 1, L"Arial", 20, FW_BOLD );
	g_SampleUI.SetFont( 2, L"Arial", 16, FW_NORMAL );
	
	g_SampleUI.AddStatic( IDC_OBJNAME, L"Pick object", 0, 0, 200, 30 );
	g_SampleUI.GetStatic( IDC_OBJNAME )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_OBJNAME )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_OBJNAME )->GetElement(0)->iFont = 1;

	g_SampleUI.AddStatic( IDC_STATIC7, L"angleX:",210,0,50,30 );
	g_SampleUI.GetStatic( IDC_STATIC7 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC7 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC7 )->GetElement(0)->iFont = 2;

	g_SampleUI.AddStatic( IDC_STATIC8, L"angleY:",260,0,50,30 );
	g_SampleUI.GetStatic( IDC_STATIC8 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC8 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC8 )->GetElement(0)->iFont = 2;

	//width edit box
	g_SampleUI.AddStatic( IDC_STATIC1, L"Width", 0, 50, 200, 30 );
	g_SampleUI.GetStatic( IDC_STATIC1 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC1 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC1 )->GetElement(0)->iFont = 2;
    g_SampleUI.AddEditBox( IDC_WIDTH, L"", 70, 45, 120, 30 );
	g_SampleUI.AddSlider( IDC_WIDTH_SLIDER, 200, 50, 150, 24, 1, 75, 20, false );

	//length edit box
	g_SampleUI.AddStatic( IDC_STATIC2, L"Length", 0, 80, 200, 30 );
	g_SampleUI.GetStatic( IDC_STATIC2 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC2 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC2 )->GetElement(0)->iFont = 2;
    g_SampleUI.AddEditBox( IDC_LENGTH, L"", 70, 75, 120, 30 );
	g_SampleUI.AddSlider( IDC_LENGTH_SLIDER, 200, 80, 150, 24, 1, 400, 100, false );

	//angle restrictions
	g_SampleUI.AddStatic( IDC_STATIC3, L"Angles restrictions", 0, 110, 200, 30 );
	g_SampleUI.GetStatic( IDC_STATIC3 )->GetElement( 0 )->dwTextFormat = DT_LEFT | DT_TOP;
	g_SampleUI.GetStatic( IDC_STATIC3 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC3 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddStatic( IDC_STATIC4, L"X", 20, 130, 200, 30 );
	g_SampleUI.GetStatic( IDC_STATIC4 )->GetElement( 0 )->dwTextFormat = DT_LEFT | DT_TOP;
	g_SampleUI.GetStatic( IDC_STATIC4 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC4 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddStatic( IDC_STATIC5, L"Y", 20, 160, 200, 30 );
	g_SampleUI.GetStatic( IDC_STATIC5 )->GetElement( 0 )->dwTextFormat = DT_LEFT | DT_TOP;
	g_SampleUI.GetStatic( IDC_STATIC5 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC5 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddEditBox( IDC_ANGLE_RESTRICT_XL, L"", 70, 125, 100, 30 );
	g_SampleUI.AddButton( IDC_ANGLE_RESTRICT_XL_BTN, L"A", 170, 130, 22, 22 );
	g_SampleUI.AddEditBox( IDC_ANGLE_RESTRICT_XU, L"", 220, 125, 100, 30 );
	g_SampleUI.AddButton( IDC_ANGLE_RESTRICT_XU_BTN, L"A", 320, 130, 22, 22 );
	g_SampleUI.AddEditBox( IDC_ANGLE_RESTRICT_YL, L"", 70, 155, 100, 30 );
	g_SampleUI.AddButton( IDC_ANGLE_RESTRICT_YL_BTN, L"A", 170, 160, 22, 22 );
	g_SampleUI.AddEditBox( IDC_ANGLE_RESTRICT_YU, L"", 220, 155, 100, 30 );
	g_SampleUI.AddButton( IDC_ANGLE_RESTRICT_YU_BTN, L"A", 320, 160, 22, 22 );


	//add button
	g_SampleUI.AddButton( IDC_ADDCHAIN, L"Add", 15, 200, 100, 22 );
	g_SampleUI.AddButton( IDC_REMOVECHAIN, L"Remove", 115, 200, 100, 22 );

	//offset
	g_SampleUI.AddStatic( IDC_STATIC6, L"Offset", 0, 230, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddEditBox( IDC_OFFSET_X, L"", 70, 225, 80, 30 );
	g_SampleUI.AddEditBox( IDC_OFFSET_Y, L"", 160, 225, 80, 30 );
	g_SampleUI.AddEditBox( IDC_OFFSET_Z, L"", 250, 225, 80, 30 );

	//physical stuff
	g_SampleUI.AddStatic( IDC_STATIC6, L"Displace", 0, 265, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddEditBox(IDC_DISPLACE, L"", 70, 265, 80, 30);

	g_SampleUI.AddStatic( IDC_STATIC6, L"Direction", 0, 305, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddEditBox(IDC_DIRECTION, L"", 70, 305, 80, 30);

	g_SampleUI.AddStatic( IDC_STATIC6, L"Coefficient", 0, 345, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddEditBox(IDC_COEFFICIENT, L"", 70, 345, 80, 30);

	g_SampleUI.AddStatic( IDC_STATIC6, L"Mass", 0, 385, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddEditBox(IDC_MASS, L"", 70, 385, 80, 30);

	g_SampleUI.AddStatic( IDC_STATIC6, L"Tilt", 0, 425, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddCheckBox( IDC_TILT, L"", 60, 425, 30, 30 );

	g_SampleUI.AddStatic( IDC_STATIC6, L"Pressure", 100, 425, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddCheckBox( IDC_PRESSURE, L"", 160, 425, 30, 30 );

	g_SampleUI.AddStatic( IDC_STATIC6, L"Laser", 200, 425, 70, 30 );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement( 0 )->dwTextFormat = DT_LEFT;
	g_SampleUI.GetStatic( IDC_STATIC6 )->SetTextColor( D3DCOLOR_ARGB( 255, 220, 220, 220 ) );
	g_SampleUI.GetStatic( IDC_STATIC6 )->GetElement(0)->iFont = 2;
	g_SampleUI.AddCheckBox( IDC_LASER, L"", 260, 425, 30, 30 );
}
Ejemplo n.º 4
0
        int init(PCALLBACKDXUTGUIEVENT on_gui_event, int spacing, UINT ew, UINT eh)
        {
            const int dd = spacing;
            const int db = dd * 2;

            // add to dialog manager
            hud.Init(&dlg_manager);
            hud_light.Init(&dlg_manager);
            hud_gi.Init(&dlg_manager);
            hud_postp1.Init(&dlg_manager);
            hud_postp2.Init(&dlg_manager);
            hud_debug_info.Init(&dlg_manager);

            // set callbacks
            hud.SetCallback(on_gui_event);
            hud_light.SetCallback(on_gui_event);
            hud_gi.SetCallback(on_gui_event);
            hud_postp1.SetCallback(on_gui_event);
            hud_postp2.SetCallback(on_gui_event);
            hud_debug_info.SetCallback(on_gui_event);

            int x = 0, y = 10, w = ew, h = eh;

            hud.AddStatic(IDC_FPS_COUNTER, L"FPS: ", x, y, w, h);

            hud.AddStatic(-1, L"Render targets:", x, y += db, w, h);
            hud.AddComboBox(IDC_TARGETS, x, y += dd, w, h + 2, 0, false, &combo_render_targets);

            hud.AddStatic(-1, L"Settings for:", x, y += db, w, h);
            hud.AddComboBox(IDC_SETTINGS, x, y += dd, w, h + 2, 0, false, &combo_settings);

            int start = y;
            combo_settings->AddItem(L"", 0);

            // Lights settings
            y = start;
            combo_settings->AddItem(L"Lights", reinterpret_cast<void*>(&hud_light));

            hud_light.AddStatic(-1, L"Light direction:", x, y += db, w, h);
            hud_light.AddSlider(IDC_LIGHT_DIRECTION, x, y += dd, w, h);

            hud_light.AddStatic(-1, L"Light position X/Y/Z:", x, y += db, w, h);
            hud_light.AddSlider(IDC_LIGHT_POS_X, x, y += dd, w, h);
            hud_light.AddSlider(IDC_LIGHT_POS_Y, x, y += dd, w, h);
            hud_light.AddSlider(IDC_LIGHT_POS_Z, x, y += dd, w, h);

            hud_light.AddStatic(-1, L"Flux factor:", x, y += db, w, h);
            hud_light.AddSlider(IDC_FLUX_SCALE, x, y += dd, w, h, 0, 1000, 100);

            hud_light.AddStatic(-1, L"Warmth:", x, y += db, w, h);
            hud_light.AddSlider(IDC_LIGHT_WARMTH, x, y += dd, w, h, 0, 100, 0);

            // VPL settings
            y = start;
            combo_settings->AddItem(L"GI", reinterpret_cast<void*>(&hud_gi));

            hud_gi.AddStatic(-1, L"GI scale:", x, y += db, w, h);
            hud_gi.AddSlider(IDC_GI_SCALE, x, y += dd, w, h, 0, 100, 0);

#if defined(LPV) || defined(DLPV)
            hud_gi.AddStatic(IDC_GI_INFO1, L"LPV propagations: 0", x, y += db, w, h);
            hud_gi.AddSlider(IDC_GI_PARAMETER1, x, y += dd, w, h, 0, LPV_SIZE * 2, 0);
            hud_gi.AddStatic(-1, L"LPV Flux amplifier:", x, y += db, w, h);
#else
            hud_gi.AddStatic(-1, L"Surface roughness:", x, y += db, w, h);
#endif

            hud_gi.AddSlider(IDC_GI_PARAMETER2, x, y += db, w, h, 0, 1000, 500);

            hud_gi.AddCheckBox(IDC_GI_DEBUG1, L"Debug GI", x, y += db, w, h, false);

#if defined(LPV) || defined(DLPV)
            hud_gi.AddCheckBox(IDC_GI_DEBUG2, L"Show LPV", x, y += db, w, h, false);
#endif

            // Postprocessing 1 settings
            y = start;
            combo_settings->AddItem(L"Postprocess 1", reinterpret_cast<void*>(&hud_postp1));

            hud_postp1.AddCheckBox(IDC_FXAA_ENABLED, L"FXAA", x, y += db, w, h, true);

            hud_postp1.AddCheckBox(IDC_SSAO_ENABLED, L"SSAO", x, y += db, w, h, true);
            hud_postp1.AddStatic(-1, L"SSAO factor:", x, y += db, w, h);
            hud_postp1.AddSlider(IDC_SSAO_SCALE, x, y += dd, w, h, 0, 100, 10);

            hud_postp1.AddCheckBox(IDC_GODRAYS_ENABLED, L"Godrays", x, y += db, w, h, false);
            hud_postp1.AddStatic(-1, L"Godrays tau:", x, y += db, w, h);
            hud_postp1.AddSlider(IDC_GODRAYS_TAU, x, y += dd, w, h, 1, 10, 5);

            hud_postp1.AddCheckBox(IDC_EXPOSURE_ADAPT, L"Adapt exposure", x, y += db, w, h, false);
            hud_postp1.AddStatic(-1, L"Exposure key value:", x, y += db, w, h, true);
            hud_postp1.AddSlider(IDC_EXPOSURE_KEY, x, y += dd, w, h, 0, 100, 50);
            hud_postp1.AddStatic(-1, L"Adaptation speed:", x, y += db, w, h, true);
            hud_postp1.AddSlider(IDC_EXPOSURE_SPEED, x, y += dd, w, h, 1, 100, 20);

            // Postprocessing 2 settings
            y = start;
            combo_settings->AddItem(L"Postprocess 2", reinterpret_cast<void*>(&hud_postp2));

            hud_postp2.AddCheckBox(IDC_CRT_ENABLED, L"CRT monitor", x, y += db, w, h, false);
            hud_postp2.AddCheckBox(IDC_FILM_GRAIN_ENABLED, L"Film grain", x, y += db, w, h, false);

            hud_postp2.AddCheckBox(IDC_DOF_ENABLED, L"DOF", x, y += db, w, h, false);
            hud_postp2.AddStatic(-1, L"DOF focal plane:", x, y += db, w, h);
            hud_postp2.AddSlider(IDC_DOF_FOCAL_PLANE, x, y += dd, w, h, 0, 5000, 2000);
            hud_postp2.AddStatic(-1, L"DOF COC scale:", x, y += db, w, h);
            hud_postp2.AddSlider(IDC_DOF_COC_SCALE, x, y += dd, w, h, 50, 150, 80);

            hud_postp2.AddCheckBox(IDC_BLOOM_ENABLED, L"Bloom", x, y += db, w, h, false);
            hud_postp2.AddStatic(-1, L"Bloom sigma:", x, y += db, w, h, true);
            hud_postp2.AddSlider(IDC_BLOOM_SIGMA, x, y += dd, w, h, 50, 150, 80);
            hud_postp2.AddStatic(-1, L"Bloom threshold:", x, y += db, w, h, true);
            hud_postp2.AddSlider(IDC_BLOOM_TRESHOLD, x, y += dd, w, h, 50, 250, 150);

            // Debug panel
            y = start;
            combo_settings->AddItem(L"Debug Info", reinterpret_cast<void*>(&hud_debug_info));

            hud_debug_info.AddStatic(IDC_DEBUG_INFO + 0, L"", x, y += db, w, h);

            // startup config
            hud.SetVisible(true);
            hud_light.SetVisible(false);
            hud_postp1.SetVisible(false);
            hud_postp2.SetVisible(false);
            hud_gi.SetVisible(false);
            hud_debug_info.SetVisible(false);

            return start;
        }