taichi icon indicating copy to clipboard operation
taichi copied to clipboard

GGUI Refactorization

Open PENGUINLIONG opened this issue 2 years ago • 2 comments

This issue enumerates a list of defects of GGUI that should be resolved before 1.1 release. Might overlap with #5423 .

If you have any thoughts regarding to GGUI, please feel free to place your comments here. 🤗

Renames

  • [ ] Camera should be constructed merely by its init instead of make_camera();
  • [ ] Window.get_canvas() is inconsistent with Window.GUI, rename GUI to get_gui to hint the user that there exists a cost to create an wrapper object;
  • [ ] Window.write_image() should be renamed to save_image to avoid confusion of 'writing an image to the window'.

Handiness

  • [ ] Set default values to any (potentially) optional API, including Gui.begin() and Camera.track_user_inputs(); note that the later one doesn't default to values commonly used in taichi examples;
  • [ ] Default clear color to dark gray, to help users check if they have successfully drawn sth;
  • [ ] Support constant, np.ndarray, ti.ndarray and ti.field at the same time for attributes like vertex-color; and remove dedicated per-vertex param like per_vertex_color (#5311 );
  • [ ] Support numeric keys in event handlers (#5277 ).

Correctness

  • [x] Ensure any kernel launch is submitted by synchronization before GGUI (#5131 );
  • [ ] DPI factor is not handled in GGUI, leading to a different appearance;
  • [x] Check out potential reasons Camera.track_user_inputs could fail like in https://github.com/bwzhao/TaichiPIC/tree/1689d61463f83d4713407dbb8acd2ffffed0671e.

Event Handling

  • [ ] Confusing usage of Window.is_pressed and Window.get_events; encapsulate to more semantical is_key_down(), is_key_up(), is_key_pressed (up to down) and is_key_released (down to up).

Feature Requests

  • [ ] Line drawing with adaptive line width;
  • [ ] MSAA.

cc @ailzhang @YuCrazing @Morcki

PENGUINLIONG avatar Jul 14 '22 08:07 PENGUINLIONG

Check out potential reasons Camera.track_user_inputs could fail like in https://github.com/bwzhao/TaichiPIC/tree/1689d61463f83d4713407dbb8acd2ffffed0671e.

solved, refer to this link : https://github.com/bwzhao/TaichiPIC/issues/3

Morcki avatar Jul 25 '22 11:07 Morcki

Check out potential reasons Camera.track_user_inputs could fail like in https://github.com/bwzhao/TaichiPIC/tree/1689d61463f83d4713407dbb8acd2ffffed0671e.

solved, refer to this link : bwzhao/TaichiPIC#3

Thanks!

PENGUINLIONG avatar Jul 25 '22 12:07 PENGUINLIONG