Open AmesingFlank opened 3 years ago
Hi, I am new to Taichi and glad to help improve it.
I will start from an easy widget, maybe colored text. But I do not want to dibs the whole issue. Other people can also work on it since there are so many widgets in dear imgui, if I have understood well.
Additional info for the issue:
python ./examples/ggui_examples/fem128_ggui.py
[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, osx, python 3.7.9
[Taichi] Starting on arch=metal
Traceback (most recent call last):
File "./examples/ggui_examples/fem128_ggui.py", line 95, in <module>
window = ti.ui.Window('FEM128', (512, 512))
File "/Users/gaocedidi/code/taichi/python/taichi/ui/ui.py", line 30, in __init__
err_no_ggui()
File "/Users/gaocedidi/code/taichi/python/taichi/ui/ui.py", line 26, in err_no_ggui
raise Exception("GGUI Not Available")
Exception: GGUI Not Availabl
@AmesingFlank Hi, it seems that there is only the Vulkan backend for GGUI, then why do we need to enable CUDA to compile GGUI here? https://github.com/taichi-dev/taichi/blob/master/cmake/TaichiCore.cmake#L36
set(TI_WITH_GGUI OFF)
if(TI_WITH_CUDA AND TI_WITH_VULKAN)
set(TI_WITH_GGUI ON)
endif()
@AmesingFlank Hi, it seems that there is only the Vulkan backend for GGUI, then why do we need to enable CUDA to compile GGUI here? https://github.com/taichi-dev/taichi/blob/master/cmake/TaichiCore.cmake#L36
set(TI_WITH_GGUI OFF) if(TI_WITH_CUDA AND TI_WITH_VULKAN) set(TI_WITH_GGUI ON) endif()
Currently, the Vulkan backend for GGUI is only works with the CUDA/x64 compute backend of taichi. That is, you need ti.init(arch=ti.cuda)
or ti.init(arch=ti.x64)
for GGUI to work. This will be changed in the near future, as we are planning support for GGUI to work with other compute backends such as Vulkan itself and OpenGL.
OK, get it.
Thanks for your reply.
Hi @AmesingFlank
Do we have tests for GGUI? I am trying to add some new test cases for the widget, but I did not find any.
Hi @AmesingFlank
Do we have tests for GGUI? I am trying to add some new test cases for the widget, but I did not find any.
We don't, adding tests for GGUI is on the top of my to-do list right now, but I just haven't found the time to do it :((
I am trying to add a colored text widget. You can take it as an example https://github.com/taichi-dev/taichi/pull/3078/files about how to add a new GGUI widget in Taichi. There are so many widgets not supported now. Welcome contributions!
I am unassigning myself since it is an umbrella issue.
Concisely describe the proposed feature Currently, GGUI only supports 5 basic widgets (
text
,button
,check_box
,slider_float
,color_edit_3
). It would be nice to have support for more complicated widgets such as drop-down menus, menu bars, etc.Describe the solution you'd like (if any) GGUI uses dear imgui internally. It's quite simple to write a wrapper for a widget. Take
button
for example, here are all the relevant code:https://github.com/taichi-dev/taichi/blob/2f5c9dfa5c52bc7e69e6c9ce3c8d443e69e769cf/taichi/ui/common/gui_base.h#L22 https://github.com/taichi-dev/taichi/blob/2f5c9dfa5c52bc7e69e6c9ce3c8d443e69e769cf/taichi/ui/backends/vulkan/gui.h#L43 https://github.com/taichi-dev/taichi/blob/2f5c9dfa5c52bc7e69e6c9ce3c8d443e69e769cf/taichi/ui/backends/vulkan/gui.cpp#L159-L164 https://github.com/taichi-dev/taichi/blob/2f5c9dfa5c52bc7e69e6c9ce3c8d443e69e769cf/taichi/python/export_ggui.cpp#L60-L62 https://github.com/taichi-dev/taichi/blob/2f5c9dfa5c52bc7e69e6c9ce3c8d443e69e769cf/python/taichi/ui/gui.py#L68-L74