This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-29
Channels
- # announcements (8)
- # babashka (41)
- # beginners (45)
- # calva (23)
- # cider (17)
- # cljdoc (2)
- # cljfx (9)
- # clojure (40)
- # clojure-bay-area (13)
- # clojure-czech (4)
- # clojure-europe (46)
- # clojure-germany (6)
- # clojure-nl (13)
- # clojure-serbia (3)
- # clojure-uk (9)
- # clojurescript (76)
- # conjure (7)
- # cursive (5)
- # data-science (6)
- # deps-new (7)
- # fulcro (41)
- # graalvm (2)
- # jobs (6)
- # lsp (10)
- # malli (1)
- # mid-cities-meetup (1)
- # off-topic (77)
- # polylith (40)
- # re-frame (18)
- # releases (1)
- # remote-jobs (9)
- # reveal (1)
- # rewrite-clj (1)
- # shadow-cljs (11)
- # tools-deps (3)
- # tree-sitter (3)
- # vim (8)
- # xtdb (45)
@smith.adriane - your canvas example is really good and is probably the way to go at first. I would rather use an imageview than a canvas but some people will want to use a canvas so they can render the 3d scene and then use canvas to render text and various 2d graphics on top. I guess the thing to test is the performance of the canvas at 60fps to render an HD image to the screen. If it is negligable (<< 16ms) then canvas may be the best way.
As a 3d person all I want to start with is the :draw
callback.
There are two different overall modes for rendering; one for interactive mode when a mouse click means select object or perhaps rotate scene all rendering is done via callbacks from user interaction. The second mode is a playback mode where you are playing animations or whatever and spacebar pauses/plays the scene.
The first mode I think it is clear how it works but the second mode I am not so sure really. I am also not sure the performance implications of rendering a writable image to a canvas as opposed to setting it as the image behind an imageview. So a few things to test š.
In case you didn't have enough options, there are also similar examples for https://github.com/phronmophobic/membrane/blob/master/src/membrane/skija.clj which uses lwgl and glfw rather than cljfx.
I also don't know what the performance implications, but I would be interested to hear your results since I do a similar thing to implement offscreen rendering for clj-cef: ā¢ https://github.com/phronmophobic/clj-cef/blob/main/examples/htmltoimage/src/clj_cef/htmltoimage.clj#L36 ā¢ https://github.com/phronmophobic/clj-cef/blob/main/examples/browser/src/clj_cef/browser.clj#L46
I saw Skia's implementation but I do want to have a full UI toolkit and for 95% of the application cljfx fits the bill perfectly. When I get enough going I will put that on the list to benchmark and be sure about.
I think cljfx would simplify distribution as well
I think I still needed to wrap it in something like stack-pane for some reason... Here https://github.com/vlaaad/reveal/blob/master/src/vlaaad/reveal/output_panel.clj#L462