164{
165 if (windowStat)
166 {
167 ImGui::Begin((name + "##" + uid).c_str(), &windowStat);
168 ImGui::Text("Global Settings");
169 ImGui::DragFloat(("Offset X" + std::string("##GPUNL")).c_str(), &noiseLayers[0].offsetX, 0.01f);
170 ImGui::DragFloat(("Offset Y" + std::string("##GPUNL")).c_str(), &noiseLayers[0].offsetY, 0.01f);
171 ImGui::DragFloat(("Offset Z" + std::string("##GPUNL")).c_str(), &noiseLayers[0].offsetZ, 0.01f);
172 ImGui::DragFloat(("Strength" + std::string("##GPUNL")).c_str(), &noiseLayers[0].strength, 0.01f);
173 ImGui::DragFloat(("Frequency" + std::string("##GPUNL")).c_str(), &noiseLayers[0].frequency, 0.001f);
174 ImGui::Separator();
175
176 for (int i = 1; i < noiseLayers.size(); i++)
177 {
178 if (ImGui::CollapsingHeader(("Noise Layer " + std::to_string(i + 1)).c_str()))
179 {
180 ImGui::Text("Noise Layer %d", (i + 1));
181 ImGui::DragFloat(("Offset X" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].offsetX, 0.01f);
182 ImGui::DragFloat(("Offset Y" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].offsetY, 0.01f);
183 ImGui::DragFloat(("Offset Z" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].offsetZ, 0.01f);
184 ImGui::DragFloat(("Strength" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].strength, 0.01f);
185 ImGui::DragFloat(("Frequency" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].frequency, 0.001f);
186 ImGui::DragFloat(("Domain Wrap Depth" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].domainWrapDepth, 0.1f);
187
188 if (noiseLayers[i].fractal != 0)
189 {
190 ImGui::DragFloat(("Octaves" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].octaves, 0.01f, 1, 128);
191 ImGui::DragFloat(("Lacunarity" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].lacunarity, 0.01f);
192 ImGui::DragFloat(("Gain" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].gain, 0.01f);
193 ImGui::DragFloat(("Weighted Strength" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].weightedStrength, 0.01f);
194 ImGui::DragFloat(("Ping Pong Strength" + std::string("##GPUNL") + std::to_string(i)).c_str(), &noiseLayers[i].pingPongStrength, 0.01f);
195 }
196
197 ImGui::Text("Fractal Type %f", noiseLayers[i].fractal);
198
199 if (ImGui::Button(("Change Fractal Type##GPUNL" + std::to_string(i)).c_str()))
200 {
201 noiseLayers[i].fractal += 1;
202
203 if (noiseLayers[i].fractal == 4)
204 {
205 noiseLayers[i].fractal = 0.0f;
206 }
207 }
208 }
209
210 if (ImGui::Button(("Delete" + std::string("##GPUNL") + std::to_string(i)).c_str()))
211 {
212 while (appState->states.remeshing);
213
214 noiseLayers.erase(noiseLayers.begin() + i);
215 break;
216 }
217
218 ImGui::Separator();
219 }
220
221 if (ImGui::Button("Add##GPUNL"))
222 {
224 }
225
226 ImGui::End();
227 }
228}