mirror of
https://github.com/MartinOpat/cuda-based-raytrace.git
synced 2025-06-07 02:13:10 +02:00
Implemented picker for color map
This commit is contained in:
1 parent
33365a26a7
commit
4b95bb728d
5 files changed
+44
-6
No files matched your search
@@ -71,6 +71,21 @@ void Widget::tick(double fps) {
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
// Same comments as above apply
|
||||
const char* items2[] = {"Python-like", "BPR", "Greyscale", "..."};
|
||||
if (ImGui::BeginCombo("ComboBox for color map", items2[this->tfComboSelectedColor]))
|
||||
{
|
||||
for (int n = 0; n < IM_ARRAYSIZE(items2); n++)
|
||||
{
|
||||
const bool is_selected = (this->tfComboSelectedColor == n);
|
||||
if (ImGui::Selectable(items2[n], is_selected))
|
||||
this->tfComboSelectedColor = n;
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Begin("Light Controls");
|
||||
@@ -119,10 +134,12 @@ void Widget::copyToDevice() {
|
||||
|
||||
cudaMemcpyToSymbol(&d_sigmoidShift, &this->sigmoidShift, sizeof(float));
|
||||
cudaMemcpyToSymbol(&d_sigmoidExp, &this->sigmoidExp, sizeof(float));
|
||||
cudaMemcpyToSymbol(&d_tfComboSelected, &this->tfComboSelected, sizeof(float));
|
||||
cudaMemcpyToSymbol(&d_tfComboSelected, &this->tfComboSelected, sizeof(int));
|
||||
|
||||
this->opacityConstReal = std::pow(10.0f, (-5 + 0.05 * this->opacityConst));
|
||||
cudaMemcpyToSymbol(&d_opacityConst, &this->opacityConstReal, sizeof(float));
|
||||
|
||||
cudaMemcpyToSymbol(&d_tfComboSelectedColor, &this->tfComboSelectedColor, sizeof(int));
|
||||
}
|
||||
|
||||
Widget::~Widget() {
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
char* fps;
|
||||
|
||||
int tfComboSelected;
|
||||
int tfComboSelectedColor;
|
||||
int opacityK;
|
||||
float opacityKReal;
|
||||
float sigmoidShift;
|
||||
|
||||