Camelia, the Perl 6 bug

IRC log for #openframeworks, 2013-10-18

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:55 somtd joined #openframeworks
01:25 admsyn joined #openframeworks
01:47 _ilbot joined #openframeworks
01:47 Topic for #openframeworks is now Welcome to http://openframeworks.cc/ | logs at http://irclog.perlgeek.de/openframeworks/
02:09 pizthewiz joined #openframeworks
02:47 jmw joined #openframeworks
03:10 artesdemad joined #openframeworks
03:11 artesdemad hola
03:43 jmw joined #openframeworks
03:43 jmw joined #openframeworks
03:52 somtd joined #openframeworks
04:12 pizthewiz joined #openframeworks
04:32 somtd joined #openframeworks
04:41 vade joined #openframeworks
05:02 jmw joined #openframeworks
05:33 somtd joined #openframeworks
05:39 LCID_Fire joined #openframeworks
06:31 jmw joined #openframeworks
07:35 Zovi joined #openframeworks
07:35 Zovi hi, anyone here for a quick question?
07:50 kikko_fr joined #openframeworks
07:51 Zovi hello kikko_fr!
07:52 kikko_fr hi Zovi
07:52 Zovi I have a question about OF, would you be able to help?
07:53 kikko_fr maybe :)
07:53 kikko_fr I will try
07:55 kikko_fr what's your question ?
08:01 kikko_fr Zovi ?
08:05 Zovi oh sorry
08:05 Zovi if you're still there
08:05 Zovi I'm looking for a way to use an OpenGL shader that requires a texture with basically the entire OF window
08:05 Zovi like, I want to put the shader on just a bunch of circles
08:06 Zovi that move around
08:06 Zovi so it can't be a static image grab, it has to keep grabbing
08:10 Zovi kikko_fr if you're still there
08:12 kikko_fr hmm I'm far from being a shader expert
08:12 Zovi ahh
08:12 kikko_fr but why do you want to use a texture ?
08:12 Zovi eh because that's how the shader seems to work
08:12 Zovi it's applied to a singular texture
08:12 kikko_fr ok
08:12 Zovi originally it was for video
08:12 Zovi from a webcam
08:12 Zovi so it just grabbed each frame
08:12 kikko_fr then you can probably use an FBO
08:12 Zovi FBO?
08:13 kikko_fr the class ofFBO
08:13 Zovi brb checking it
08:13 kikko_fr FBO = Frame Buffer Object
08:13 Zovi okay
08:13 kikko_fr after you've allocated your FBO, you call 'myFBO.begin()'
08:14 kikko_fr and everything you draw before you call 'myFBO.end()'
08:14 Zovi oh
08:14 kikko_fr will be drawn inside the texture of this FBO
08:14 Zovi and then I use myFBO as the texture?
08:14 kikko_fr exactly
08:14 Zovi excellent!
08:14 Zovi I'll try it and see if it works!
08:14 kikko_fr ok good luck :)
08:17 Zovi just making sure, myFBO can directly replace a texture, right?
08:17 Zovi or is there another step?
08:19 Zovi kikko_fr
08:20 kikko_fr if I'm not mistaking the fbo IS a texture
08:20 kikko_fr so you can bind it directly to your shader
08:22 Zovi mmm ok
08:22 Zovi I'm running into some errors sort of unrelated to that
08:22 Zovi I mean, related to trying to implement the fbo
08:22 Zovi this is probably just me being bad at this
08:22 Zovi I'm very new to OF
08:29 Zovi ok kikko_fr it compiles and renders nothing
08:29 Zovi I'm obviously missing a step here
08:30 Zovi it doesn't draw any of the things in the begin -> end
08:31 Zovi or maybe it's just drawing once really fast and then blanking out
08:31 kikko_fr could you extract this part of your code to have a look?
08:32 Zovi er yeah one sec I think I broke something else
08:35 Zovi kikko_fr http://pastebin.com/ysaFBN5P
08:35 Zovi tex1 was an ofTexture that I made into an ofFbo
08:36 Zovi and fishshader is confirmed to work normally
08:42 kikko_fr ok
08:42 kikko_fr not sure about this but
08:42 kikko_fr can you try to remove the bind / unbind
08:42 kikko_fr and replace
08:42 kikko_fr fishShader.setUniformTexture("tex0", tex1, 0);
08:42 kikko_fr by fishShader.setUniformTexture("tex0", tex1.getTextureReference(), 0);
08:43 kikko_fr also I think you have to use another fbo
08:44 kikko_fr otherwise the shader won't be called
08:44 kikko_fr oh no you're drawing a quad already
08:45 kikko_fr (I'm looking at the multiTextureShaderExample) in the OF example folder
08:55 Zovi ok I'm back sorry
08:56 Zovi it drew a blue rectangle
08:56 Zovi uhh
08:56 Zovi no wait all of it is blue
08:56 Zovi regardless nah it didn't work
08:56 Zovi it basically drew the rectangle that everything should be in, but it drew it blue
08:57 Zovi it also doesn't move
08:57 Zovi or change (which it should) when bNoise is true
08:57 Zovi which is when you hold down the mouse button
08:57 Zovi kikko_fr
08:59 kikko_fr can you draw the FBO to make sure your circles are drawn in it ?
08:59 kikko_fr using tex1.draw(); instead of the shader / quad draw
08:59 Zovi ok let's see
09:00 Zovi it wants coordinates
09:01 Zovi I tried 0,0 and it came up as just black
09:01 Zovi which is the background colour
09:04 kikko_fr ok so there is a problem here already
09:04 kikko_fr the FBO should have you circles
09:05 kikko_fr you're allocating it in the setup method ?
09:05 Zovi tex1.allocate(400, 400, GL_RGB, GL_RGBA);
09:05 Zovi I've got that
09:05 Zovi in the setup
09:09 kikko_fr yes that's correct
09:11 kikko_fr in your draw method after drawing your circles, you have something like 'tex1.end(); tex1.draw(0,0); return;' ?
09:11 Zovi yeah
09:11 kikko_fr that should definitely draw your circles on screen
09:11 Zovi huh
09:11 kikko_fr :D
09:12 Zovi D:
09:12 Zovi nah it's not doing it
09:13 Zovi there must be something I forgot
09:13 Zovi maybe in the declaration in the .h file
09:13 Zovi the line
09:13 Zovi ofFbo tex1;
09:13 Zovi should suffice, right?
09:14 kikko_fr yes
09:14 kikko_fr is there anything written in the console ?
09:15 Zovi yeah uh
09:15 Zovi not sure how to copy so I'll just type
09:16 Zovi [notice ] ofFbo: checkGLSupport(): maxColorAttachments: 8, maxDrawBuffers: 8, maxSamples: 8
09:16 Zovi there's more
09:16 kikko_fr so FBOs are supported
09:16 Zovi [warning] ofFbo: allocate(): clamping numSamples 6408 to maxSamples 8 for frame buffer object0
09:17 Zovi [warning] ofShader: GL_VERTEX_SHADER shader reports:
09:17 Zovi Vertex shader was successfully compiled to run on hardware.
09:17 Zovi [warning] ofShader: GL_FRAGMENT_SHADER shader reports:
09:17 Zovi Fragment shader was successfully compiled to run on hardware.
09:17 Zovi and then some other things I know about.
09:17 Zovi that's it
09:18 kikko_fr can you try removing 'GL_RGB, GL_RGBA' from the fbo.allocate  ?
09:19 Zovi well
09:19 Zovi that removed the allocate() warning from the console
09:19 Zovi but there's no difference
09:20 kikko_fr ok we must be missing something here
09:20 kikko_fr maybe you can try to run the gl/multiTextureShaderExample
09:20 kikko_fr and start from there
09:21 kikko_fr it's fairly close to what you are trying to do
09:21 kikko_fr using an FBO inside a shader
09:23 Zovi I'll take a look at it
09:26 Zovi it looks like the stuff in the update method is important
09:27 Zovi oh oh
09:27 Zovi draw goes inside
09:27 Zovi maybe
09:28 Zovi well that didn't fix it but it's on the right track
09:40 Zovi kikko_fr any other ideas?
10:55 somtd joined #openframeworks
11:18 peejay joined #openframeworks
11:57 jmw joined #openframeworks
12:47 vade joined #openframeworks
13:05 kikko_fr joined #openframeworks
13:09 mickman112 joined #openframeworks
13:14 vade joined #openframeworks
13:52 superFluid joined #openframeworks
13:56 superFluid joined #openframeworks
14:22 jacres joined #openframeworks
14:42 somtd joined #openframeworks
14:44 superFluid joined #openframeworks
14:51 jedahan joined #openframeworks
15:07 vade joined #openframeworks
15:40 jedahan joined #openframeworks
15:50 laserpilot1 joined #openframeworks
15:51 laserpilot1 anyone know the best/proper way to sync ofRandom values between different versions of apps (ie sending the same number to ofSeedRandom on load?)
15:54 tgfrerer laserpilot: you could start your app from the command line, passing a random seed parameter
15:55 tgfrerer and generate that random seed parameter in a batch file that calls the apps, so that it's the same parameter
15:55 laserpilot1 thanks - if i just have an OSC function that receives a value that sets the random seed while theyre all running, would that work as well, or does it only work on setup?
15:55 laserpilot1 and if i have randoms in a bunch of subclasses, would it trickle down to all of those, or would something else happen
16:01 tgfrerer as long as both apps are the same, and the random number generator is called in exactly the same sequence in both apps and randseed initialised the same, this should work.
16:01 laserpilot1 ok
16:05 tgfrerer laserpilot: also make sure both apps update() at the same time (or wait for each other) or the random numbers will get out of sync (as the frames will) - most pixels ever is pretty helpful for stuff like this =)
16:18 laserpilot1 ok thanks, super helpful
16:35 LCID_Fire joined #openframeworks
16:53 jvcleave joined #openframeworks
17:13 somtd joined #openframeworks
17:18 pizthewiz joined #openframeworks
17:23 LCID_Fire joined #openframeworks
17:54 admsyn joined #openframeworks
17:59 LCID_Fire joined #openframeworks
18:04 Seich joined #openframeworks
18:18 LCID_Fire joined #openframeworks
18:19 somtd joined #openframeworks
18:22 LCID_Fire joined #openframeworks
18:32 fossterer joined #openframeworks
18:32 fossterer hello! I'm new to Openframeworks!
18:35 admsyn fossterer: hi!
18:38 fossterer Hi I'm looking at androidcameraexample... I don't get why vidoegrabber is used instead of camera
18:38 admsyn instead of ofCamera you mean?
18:39 fossterer yes
18:39 admsyn ofCamera is for controlling 3d rendering, so you have an ofCamera in a scene and that determines how your 3d objects are rendered
18:40 admsyn nothing to do with an actual device's camera :)
18:41 fossterer I don't see a capture button in the app to get teh picture..
18:43 admsyn ofVideoGrabber doesn't do that on its own, it's not the same as e.g. the android camera app
18:44 fossterer Then why do I invoke it at all when there's no way to hold on the scene?
18:46 admsyn by hold on to the scene do you mean record pictures or video?
18:47 fossterer yes.. otherwise capture a picture..
18:47 fossterer picture or video
18:47 admsyn well, you can add some code to do some recording of pictures or video, but the ofVideoGrabber doesn't do it on its own
18:48 admsyn it's just a component you can use, not a whole app
18:48 admsyn so you could do live camera vision with it, for example
18:48 laserpilot1 yeah you need an extra addon to do recording
18:49 fossterer Well, I get this as - I cannot use 'androidCameraExample' to capture a picture.. Is that all?
18:49 laserpilot1 you can probably do that
18:49 laserpilot1 on the ofxiPhone addon there is a way to capture an image to the iOs camera gallery - i dont know android, but im betting that has something similar
18:50 laserpilot1 doing video recording on mobile is a whole different beast for OF
18:50 fossterer laserpilot1: by addon do you mean they ARE DOWNLOADABLE?
18:50 fossterer sorry for the Caps... unintended
18:51 admsyn fossterer: what the androidCameraExample is demonstrating is giving you access to the raw camera stream, you can add things on top of it to make something like a photo-taking app if you like
18:51 laserpilot1 sometimes downlaodable - look at ofxaddons.com but those tend to be mostly for windows/osx/linux, there are less addons for android and ios
18:52 admsyn the line "grabber.draw(20, 20);" is taking the most recent image from the camera and drawing it to the screen, you could add your own code to (for example) write that to a file instead
18:52 laserpilot1 but yeah, you have to do a little more work with the camera example to have it capture an image
18:54 fossterer Well you guys are helpful... :-) and yeah admsyn: thanks for the tip! Now I should create a button from Android as usual and make its click handle the 'grabber.draw(20, 20)' result?
18:55 admsyn yeah that'd be a start :) what that would do is basically draw the most recent camera image to the screen every time the button is pressed
18:55 fossterer ohh no.. how can I make it save to file then?
18:56 admsyn the steps would be basically 1) get the image out of the ofVideoGrabber and then 2) save that image to disk
18:57 admsyn 1) would basically be to call grabber.getPixels() on it, which you can use to create an ofImage
18:58 admsyn and then 2) would be to call ofSaveImage() with your ofImage
18:58 laserpilot1 and there is probably an android specific version of ofSaveImage somewhere in the codez
18:59 admsyn yeah I'm not sure if there's any extra tricks due to Android, but that's basically the gist
18:59 fossterer ohh.. 'getPixels()' converts raw stream to meaningful format and 'ofSaveImage()' saves to disk?
18:59 admsyn yepp :)
18:59 admsyn in this case "meaningful format" is just a unsigned char *
19:00 admsyn i.e. an array of bytes
19:01 admsyn actually you might be able to shortcut it by just doing ofSaveImage(grabber.getPixelsRef(), "my_image.png");
19:02 fossterer ofSaveImage documentation says it handles ofPixels... I am assuming it is same as unsigned char * Right?
19:03 admsyn ofPixels is a wrapper for an unsigned char *, so they're not exactly the same
19:03 admsyn but ofSaveImage does take an ofPixelsRef, and grabber.getPixelsRef() will give you one of those
19:04 fossterer ohh.. then as you pointed out earlier -"ofSaveImage(grabber.getPixelsRef(), "my_image.png");" does everything itself?
19:05 admsyn I think it should yeah, I don't have an IDE in front of me to check
19:05 admsyn you might need to do an intermediary line of code or two, but that should basically be it
19:06 fossterer ohh.. np I will check into it.. thanks but I don't understand why the stream stops after some 5-6 secs..
19:06 admsyn just the regular androidCameraExample?
19:06 fossterer I mean the video stream I see on device becomes stationary after.. yeah the regular example..
19:07 fossterer I tried removing if conditions
19:07 fossterer and others
19:07 admsyn might be an issue with your phone (as in, oF on your phone)
19:08 fossterer really? you sure that it should run forever in any other phone?
19:08 admsyn so it just stops showing new images, but doesn't crash?
19:08 admsyn I'm not sure, I don't do much android at all..
19:09 fossterer not crash.. just stops at the last recent frame it showed
19:10 admsyn huh, well that's no good
19:10 admsyn what kind of phone?
19:11 admsyn *android device?
19:13 fossterer HTC  with Android 4.1
19:14 admsyn alright, and can you post the testApp.cpp you're running to pastebin.com?
19:16 fossterer sure..
19:18 fossterer http://pastebin.com/AXiW29GW
19:19 admsyn it might have something to do with the size of the videoGrabber you're running (  grabber.initGrabber(1024,768); )
19:19 admsyn can you try it with just 320, 240 and see if it still hangs after ~5secs?
19:19 somtd joined #openframeworks
19:22 fossterer yeah it still does the same
19:24 admsyn not sure then vOv
19:25 admsyn it would make sense if it did that after a few seconds if you were running a 1024 / 768 capture, since it'd probably blow out the memory on the device super fast
19:25 admsyn I'd think
19:26 fossterer the worst part is it doesn't work at all in emulator...
19:26 fossterer only the camera example.. every other is fine
19:29 admsyn does the android emulator give you a camera?
19:29 admsyn as in, if you were to do just regular android dev in eclipse or whatever do you get to use your laptop's camera?
19:32 robot joined #openframeworks
19:32 fossterer Awesome admsyn.. your line above is really sAVing to sdcard on my phone :-)
19:32 admsyn wicked :)
19:33 fossterer yeah.. I've a webcam connected to this desktop
19:33 fossterer I could take a nice picture [giggles] of mine from native camera app on emulator
19:34 admsyn ah alright then
19:34 fossterer but this app just shows those 'black and white squares and a green box
19:34 fossterer which you get when ther's no camera connected
19:34 admsyn I don't have much to offer there, it sounds like either you're running out of memory or openFrameworks and your phone don't get along
19:39 fossterer alright... the last doubt pestering me... my app requirement is just to grab some picture and later process it using OF libraries.. In this regard is the ofVideoGrabber preferrable over regular android's Camera intent?
19:40 fossterer or am I better keep away from it.. I mean is it more resource consuming, slow or any other compared to regular camera calls?
19:40 admsyn ofVideoGrabber is mostly geared towards giving you a raw stream of live video, so you can do things like camera vision or other analysis-type things on it
19:40 admsyn you can use it for photo or video capture as well, but it's less suited to that than the default android things are
19:41 admsyn if you're comfortable with the android stuff, and getting data from Java into C++ isn't a major hurdle for you, I have a feeling that'll work out best
19:42 fossterer Cool.. well.. thank you very much for the help admsyn: and laserpilot1
19:42 admsyn oF is more geared towards entirely realtime trickery, as opposed to offline processing, but you can still do it
19:42 admsyn no problem and good luck!
19:42 fossterer you have no idea how bad I felt for the last 4 weeks being unable to get a single thing work
19:42 admsyn :(
19:42 fossterer I mean setting up in eclipse that throwed up as many as 4 bugs
19:43 fossterer that I had to manually look into
19:43 fossterer just curious! are you associated directly with this project?
19:43 admsyn openFrameworks? more-or-less
19:44 fossterer more-or-less... well can I report the bugs and send patches?
19:44 admsyn yepp
19:44 admsyn it all takes place on github
19:44 fossterer Is this android part of OF still active at all?
19:44 admsyn yepp
19:46 jmw joined #openframeworks
19:46 admsyn if your camera issue turns out to be an openFrameworks bug on HTC devices, it'd be great to have an open issue about it on github
19:46 fossterer ohh... where can I get to see the maintainer of this on that github page?
19:47 admsyn https://github.com/openframeworks/open​Frameworks/issues?direction=desc&p​age=1&sort=updated&state=open
19:48 fossterer haa.. I got the link but I really have no idea how to know who the mantainer of certain module is for me to contact
19:49 fossterer I'm newbie to github
19:50 admsyn you don't have to contact anyone in particular, if you open an issue like "ofVideoGrabber stream cuts out on HTC whatever" then it'll be seen
19:51 admsyn make sure you include the code you're running and any other details that might be important
19:51 fossterer ohh.. not that one.. I meant those 4 issues (killing at first but turned out ot be trivial at the end :P )
19:51 fossterer for which I could submit patches
19:53 admsyn oh I see
19:53 admsyn the process for that is to fork openFrameworks, fix your stuff on a new branch, and then send a pull request from your branch to openFrameworks from there
19:54 admsyn see here : https://github.com/openframeworks/open​Frameworks/blob/master/CONTRIBUTING.md
19:54 fossterer Is that tis 'CONTRIBUTING.MD' file that I should.. ohh yeah I'm exactly typing that now
19:54 fossterer :D
19:55 fossterer That's all for now friend admsyn:
19:55 fossterer Do I get to meet you this time any day?
19:56 admsyn well, I'm here a lot if that's what you mean :)
19:56 fossterer I mean can I count on you in case I need help (only badly)
19:57 fossterer ohh.. cool I remember certain projects' IRCs where my 'Hi!' stays forever there
19:57 fossterer well thanks for the help admsyn: and laserpilot1
19:57 fossterer bye
19:57 fossterer laserpilot1: Thank you
19:57 fossterer bye
19:59 fossterer Hope I didn't irritate any of you!
19:59 laserpilot1 nope!
20:00 admsyn naw, good luck :)
20:20 somtd joined #openframeworks
20:24 joshuajnoble joined #openframeworks
20:29 vade joined #openframeworks
20:30 LCID_Fire joined #openframeworks
21:02 LCID_Fire joined #openframeworks
21:20 somtd joined #openframeworks
21:50 medium_peter joined #openframeworks
22:13 jmw joined #openframeworks
22:20 somtd joined #openframeworks
22:55 jmw joined #openframeworks
23:21 somtd joined #openframeworks

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary