Comments (9)
from mosaic.
I'm having trouble drawing OF stuff inside objects, it seems like imgui is always rendering on top of everything.
In the image you can see the video grabber object rendering the webcam image under the object window.
Did you know how to solve this?
from mosaic.
Hmm, I didn't think about that case where you need to draw the GUI from OF.
One way would be to let objects draw after ImGui has flushed the graphics pipeline, so you can draw on top of it. (This happens when you call ofxImGui->end()
in auto mode or ofxImGui->draw()
in manual mode with my fork.)
Otherwise, we might be able to make a transparent zone so we can draw behind objects.
Both feel pretty hacky...
Another option is to link a texture-ID in order to display images. An image tex id can be an FBO tex ID, I think.
Do lots of objects have/need "custom GUIs" ? (involving drawing from OF)
from mosaic.
Basically most of the objects that works with video/webcam/images, drawing ofTextures inside the objects, and sound objects with signal waveform visualizer (ofPolyline) or fft data (audio analysis).
The linking of a texture id from an FBO seems the better choice, i'll check it.
Don't like the transparent zone option, but i'm going to try them all and we'll talk again.
from mosaic.
Got it!
using ofTexture with proper allocate:
ofTextureData texData;
texData.width = camWidth;
texData.height = camHeight;
texData.textureTarget = GL_TEXTURE_2D;
texData.bFlipTexture = true;
static_cast<ofTexture *>(_outletParams[0])->allocate(texData);
and calling a method from ofxImGui helpers did the trick:
ofxImGui::AddImage(*static_cast<ofTexture *>(_outletParams[0]), ImVec2(this->width*_nodeCanvas.GetCanvasScale(), this->height*_nodeCanvas.GetCanvasScale()));
So, problem solved, for ofPolyline waveform graphics, with ofTexture.bind()/unbind() will work!
from mosaic.
Yes, the FBO option would be the best option, that keeps Gui separated and "canalised" (with API methods). (don't spend too much time on the other solutions?)
Seems pretty simple to do in fact.
One drawback with FBOs : on small hardware (with integrated GPU), we'll have to check what the FBO limit is and what happens when there's too much FBO objects to allocate ? We can always disable preview mode on nodes if hardware doesn't allow having too much.
For plotting, checkout the ImGui demo ImGui::PlotHistogram()
, eventually some ImGuiExtension. Although drawing the GUI with OF will give a better example on how to use object data ?
Edit: Ok, great, works fine for FBOs. :)
from mosaic.
Actually there's no need for FBO, just using the link ofTexture pointer, so no GPU limits problem, it works like a charm!
But is a really good idea to have a mechanism enabling/disabling automatic preview depending on the resources
Great the plotting from imgui, i'll check it!
from mosaic.
Porting objects...
from mosaic.
oscillator and envelopes sound objects
this starts to look good!
from mosaic.
Related Issues (20)
- Mosaic crashes on Mac with example files HOT 3
- Linux - Internet not avaliable
- Ubuntu compile issues HOT 2
- Instant crash on launch HOT 3
- VP_LINK_FBO : A render pass for each object ? HOT 13
- Older GPUs and OpenGL 4.1 HOT 2
- No sound menu on Windows 10 ... HOT 1
- [WSL] bwrap: kernel does not support user namespaces HOT 1
- Mosaic patch in xCode HOT 4
- Settings or options for GUI / font sizes? HOT 4
- Mosaic still running after closing using window X in Ubuntu HOT 1
- inputs in glsl nodes HOT 2
- Corrade / Magnum HOT 4
- osx 10.12 support HOT 1
- Instant crash on macOS HOT 6
- Version 0.6.5_ofximgui_next does not render the UI properly. HOT 3
- Error in compile mosaic on Mint 20 HOT 1
- Error in compile on Mint: ofxFFmpegRecorder
- VideoGraber crash Mosaic on Mint with OF(Mosaic) HOT 5
- Flatpack update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mosaic.