18{
19 ImGui::Begin("Texture Baker", pOpen);
20
21 if(ImGui::CollapsingHeader("Preview"))
22 {
23 ImGui::Image((ImTextureID)previewFrameBuffer->GetColorTexture(), ImVec2(256, 256));
24 }
25
26 if (ImGui::BeginCombo("Texture Slot##combo", textueBakerSlots[currentTextureSlot]))
27 {
28 for (int i = 0; i < IM_ARRAYSIZE(textueBakerSlots); i++)
29 {
30 bool is_selected = (currentTextureSlot == i);
31 if (ImGui::Selectable(textueBakerSlots[i], is_selected))
32 {
33 currentTextureSlot = i;
34 }
35
36 if (is_selected)
37 ImGui::SetItemDefaultFocus();
38 }
39 ImGui::EndCombo();
40 }
41
42 ImGui::Checkbox("Use Tiled Export", &useTiledExport);
43
44 if(useTiledExport)
45 {
46 ImGui::DragInt("Tile Resolution", &tileResolution);
47 ImGui::DragInt("Tile Count", &tileCount);
48
49 ImGui::InputInt("Tile X", &tileX);
50 ImGui::InputInt("Tile Y", &tileY);
51 }
52 else
53 {
54 ImGui::DragInt("Bake Resolution", &tileResolution);
55 }
56
57 if(currentTextureSlot == 0)
58 {
59 if(ImGui::Button("Calculate Heigt Map Min Max"))
60 {
61 while(appState->states.remeshing);
62 CalculateHeightMapMinMax();
63 }
64 ImGui::DragFloat2("Height Map Min Max", heightMapMinMax, 0.01f);
65 }
66
67 if(ImGui::Button("Bake"))
68 {
69 Bake();
70 }
71
72 ImGui::End();
73
74 Update();
75}