GithubHelp home page GithubHelp logo

Comments (9)

d3cod3 avatar d3cod3 commented on May 17, 2024 1

Sin título

from mosaic.

d3cod3 avatar d3cod3 commented on May 17, 2024

mosaicScreenshot_200414

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.

Daandelange avatar Daandelange commented on May 17, 2024

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.

d3cod3 avatar d3cod3 commented on May 17, 2024

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.

d3cod3 avatar d3cod3 commented on May 17, 2024

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!

mosaicScreenshot_200415

from mosaic.

Daandelange avatar Daandelange commented on May 17, 2024

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.

d3cod3 avatar d3cod3 commented on May 17, 2024

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.

d3cod3 avatar d3cod3 commented on May 17, 2024

Sin título

photo_2020-06-11 17 23 50

photo_2020-06-11 17 24 07

Porting objects...

from mosaic.

d3cod3 avatar d3cod3 commented on May 17, 2024

Sin título

Sin título2

oscillator and envelopes sound objects

this starts to look good!

from mosaic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.