rokups / ImNodes

Node graph implementation for Dear ImGui. Used in https://github.com/rokups/rbfx
MIT License
656 stars 57 forks source link

compute graph example #21

Open sonoro1234 opened 3 years ago

sonoro1234 commented 3 years ago

Hi,

I would like to share a compute graph made with ImNodes in LuaJIT-ImGui All above line https://github.com/sonoro1234/LuaJIT-ImGui/blob/master/examples/cimnodes_r_graph_sample.lua#L378 are the classes needed for the example, below this line there is the user code defining the nodes which can be changed at will.

With the nodes defined in this case this is the result: compute_r_GIF

rokups commented 3 years ago

Since also you tried doing same thing with https://github.com/Nelarius/imnodes, could you share your impressions? Any likes or dislikes in both? Library from @Nelarius seems to be rather complete, at this point it makes me thing my project is pointless waste of time and maybe should be archived.

sonoro1234 commented 3 years ago

The main advantage of you library compared to Nelarius is that node pins have kind (SlotInfo kind) and Nelarius dont have it. This could be very important in a compute graph with different kind of data (float, matrix, texture) Also, Nelarius library has a lot of internal complications (altought not seen by the user) that have make appear some subtle bugs and your library is quite simple, so less prone to bugs. The worst thing in your library is that node ids are taken from node pointer instead of a user provided unique id, it makes things more complex but I could manage (In LuaJIT-ImGui) to take a user provided id and cast it to void* to allow saving and loading the graph.

at this point it makes me thing my project is pointless waste of time and maybe should be archived.

I dont think so. It has some advantages that could be useful depending on use case.

rokups commented 3 years ago

That is some inspiring feedback. Thank you :pray: :)