openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

Feature elinux programmable gl #144

Closed arturoc closed 11 years ago

arturoc commented 11 years ago

merges latest changes to the gles2 branch (now compatible with gl3 thanks to @tgfrerer) and latest from develop

haven't tested yet so might be good to give it a try before merging, i'll try it later.

bakercp commented 11 years ago

Am going to test it out. @arturoc does it make sense to merge this before or after we catch up with develop?

arturoc commented 11 years ago

this includes develop, so i think it makes sense to merge it before merging into develop since it has the definitive naming... for the renderers and everything is compatible with desktop.

but perhaps is better to wait after resonate to not break anything

arturoc commented 11 years ago

this is ready to merge, there's still some minor things to fix and i'll probably integrate philp's glfw branch before merging into develop but it's already working better than the current GLES2 implementation in terms of performance and compatibility. lot's of fixes also for orientation...

danzeeeman commented 11 years ago

Cool should we test this on all ES2 devices including droid? On Apr 4, 2013 7:04 AM, "arturo" notifications@github.com wrote:

this is ready to merge, there's still some minor things to fix and i'll probably integrate philp's glfw branch before merging into develop but it's already working better than the current GLES2 implementation in terms of performance and compatibility. lot's of fixes also for orientation...

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/pull/144#issuecomment-15891251 .

arturoc commented 11 years ago

android still needs some work, it's almost ready but i need to do something to select gles1/2 in the java side according to the selected renderer

danzeeeman commented 11 years ago

I know how to do that...done it plenty of time. You got a branch I could work on? On Apr 4, 2013 1:19 PM, "arturo" notifications@github.com wrote:

android still needs some work, it's almost ready but i need to do something to select gles1/2 in the java side according to the selected renderer

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/pull/144#issuecomment-15911010 .

arturoc commented 11 years ago

i still have some uncommitted changes for android. but yes i know how to enable gles2 the problem is more of how to sync the c++ and java side so when selecting the renderer the java side is initialized with gles1 or 2.

danzeeeman commented 11 years ago

So what I would do here is implement an App class that extends Application and in the on create() method do a GL version check then set a property. When the OF activity launches it reads from the properties then passes in the GL version. We can also just default to ES2 with a manifest flag for Android. I think the numbers are down to 0.1 percent of devices only support ES 1.

i still have some uncommitted changes for android. but yes i know how to enable gles2 the problem is more of how to sync the c++ and java side so when selecting the renderer the java side is initialized with gles1 or 2.

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/pull/144#issuecomment-15911708 .

danzeeeman commented 11 years ago

I tested this on my Pi last night. Everything looked ok. I should compile a good test app to see if this breaks anything.

jvcleave commented 11 years ago

@danthemellowman @arturoc maybe I am doing something wrong in git but I can't compile OF

This is the error I get

../../../libs/openFrameworks/app/ofAppEGLWindow.cpp:32:29: fatal error: ofGLES2Renderer.h: No such file or directory
kalwalt commented 11 years ago

@jvcleave are you sure to git succesfully? i think ofGLES2Renderer isn't used anymore... i will try this branch too, but with pandaboard.

jvcleave commented 11 years ago

@kalwalt not yet - these are the commands I used

git checkout -b arturoc-feature-elinuxProgrammableGL develop-raspberrypi
git pull https://github.com/arturoc/openFrameworks.git feature-elinuxProgrammableGL
kalwalt commented 11 years ago

@jvcleave i'm grabbing the feature-elinuxProgrammableGL branch ,soon i will test it. I don't see anything wrong in your git.

danzeeeman commented 11 years ago

Yeah this worked perfectly for me. Hmmm. On May 2, 2013 12:42 PM, "Walter Perdan" notifications@github.com wrote:

@jvcleave https://github.com/jvcleave i'm grabbing the feature-elinuxProgrammableGL branch ,soon i will test it. I don't see anything wrong in your git.

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/pull/144#issuecomment-17349488 .

kalwalt commented 11 years ago

I'm testing it with my Pandaboard and i can confirm that error you get @jvcleave . Should use this branch the new ofProgrammableGL.h ? if yes i think that @arturoc missed some commits. I had this similar issue triyng the elinux-programmableGLFW branch. @danthemellowman that' really strange ...

danzeeeman commented 11 years ago

yeah its weird...I'll double check when I get home...I might have been on the wrong branch or something...really weird.

On Thu, May 2, 2013 at 3:34 PM, Walter Perdan notifications@github.comwrote:

I'm testing it with my Pandaboard and i can confirm that error you get @jvcleave https://github.com/jvcleave . Should use this branch the new ofProgrammableGL.h ? if yes i think that @arturochttps://github.com/arturocmissed some commits. I had this similar issue triyng the elinux-programmableGLFW branch. @danthemellowman https://github.com/danthemellowman that' really strange ...

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/pull/144#issuecomment-17359582 .

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

kalwalt commented 11 years ago

i switched to the ofAppEGLWindow.h from the artutoc elinuxGLFW https://github.com/arturoc/openFrameworks/blob/feature-elinuxProgrammableGLFW/libs/openFrameworks/app/ofAppEGLWindow.cpp needed some little changes in some

ofGetProgrammableGLRenderer()->setup(); to ofGetProgrammableGLRenderer()->startRender();

anyway it fails in ofAppGLFWWindow.cpp line 166 error glewInit was not declared line 539 error glDrawBuffer was not declared

jvcleave commented 11 years ago

ok - I also pulled this into my local branch https://github.com/arturoc/openFrameworks/blob/feature-elinuxProgrammableGLFW/libs/openFrameworks/app/ofAppEGLWindow.cpp

I get past ofAppEGLWindow but then I get a few more things in ofVbo.cpp

../../../libs/openFrameworks/gl/ofVbo.cpp:63:31: error: ‘glDeleteVertexArrays’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:68:30: error: ‘glDeleteVertexArrays’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp: In member function ‘void ofVbo::bind()’:
../../../libs/openFrameworks/gl/ofVbo.cpp:585:30: error: ‘glGenVertexArrays’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:589:25: error: ‘glBindVertexArray’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp: In member function ‘void ofVbo::unbind()’:
../../../libs/openFrameworks/gl/ofVbo.cpp:710:21: error: ‘glBindVertexArray’ was not declared in this scope

and in ofProgrammableGLRenderer.cpp

../../../libs/openFrameworks/gl/ofProgrammableGLRenderer.cpp: In member function ‘void ofProgrammableGLRenderer::beginDefaultShader()’:
../../../libs/openFrameworks/gl/ofProgrammableGLRenderer.cpp:786:8: error: ‘GL_TEXTURE_RECTANGLE_ARB’ was not declared in this scope
../../../libs/openFrameworks/gl/ofProgrammableGLRenderer.cpp:800:8: error: ‘GL_TEXTURE_RECTANGLE_ARB’ was not declared in this scope
../../../libs/openFrameworks/gl/ofTexture.cpp: In function ‘int ofGetGLFormatFromInternal(int)’:
../../../libs/openFrameworks/gl/ofTexture.cpp:156:9: error: ‘GL_DEPTH_STENCIL’ was not declared in this scope
../../../libs/openFrameworks/gl/ofTexture.cpp: In function ‘int ofGetGlTypeFromInternal(int)’:
../../../libs/openFrameworks/gl/ofTexture.cpp:215:8: error: ‘GL_DEPTH_STENCIL’ was not declared in this scope
../../../libs/openFrameworks/gl/ofTexture.cpp:216:12: error: ‘GL_UNSIGNED_INT_24_8’ was not declared in this scope
../../../libs/openFrameworks/app/ofAppGLFWWindow.cpp: In member function ‘virtual void ofAppGLFWWindow::setupOpenGL(int, int, int)’:
../../../libs/openFrameworks/app/ofAppGLFWWindow.cpp:166:11: error: ‘glewInit’ was not declared in this scope
../../../libs/openFrameworks/app/ofAppGLFWWindow.cpp: In member function ‘void ofAppGLFWWindow::display()’:
../../../libs/openFrameworks/app/ofAppGLFWWindow.cpp:539:24: error: ‘glDrawBuffer’ was not declared in this scope
arturoc commented 11 years ago

that should fix compiling in GL ES. i haven't tried it yet, i think VAO's might crash on some platforms: on android they don't exist but it seems like they exist on iphone for example, so i would need to check for the extension instead of directly defining them in ofVbo.

Let me know if it works, i'll try to test it on both rpi and pandaboard later

jvcleave commented 11 years ago

OF compiled!

jvcleave commented 11 years ago

aca204a update does this

../../../libs/openFrameworks/gl/ofVbo.cpp: In constructor ‘ofVbo::ofVbo()’:
../../../libs/openFrameworks/gl/ofVbo.cpp:93:53: error: ‘RTLD_DEFAULT’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:93:86: error: ‘dlsym’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:95:32: error: ‘glBindVertexArrayArraysType’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:95:60: error: expected ‘;’ before ‘dlsym’
../../../libs/openFrameworks/gl/ofVbo.cpp:97:53: error: ‘RTLD_DEFAULT’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:97:89: error: ‘dlsym’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:99:32: error: ‘glBindVertexArrayArraysType’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp:99:60: error: expected ‘;’ before ‘dlsym’
../../../libs/openFrameworks/gl/ofVbo.cpp: In member function ‘void ofVbo::bind()’:
../../../libs/openFrameworks/gl/ofVbo.cpp:618:25: error: ‘glBindVertexArray’ was not declared in this scope
../../../libs/openFrameworks/gl/ofVbo.cpp: In member function ‘void ofVbo::unbind()’:
../../../libs/openFrameworks/gl/ofVbo.cpp:739:21: error: ‘glBindVertexArray’ was not declared in this scope
jvcleave commented 11 years ago

and all good again :)

kalwalt commented 11 years ago

can confirm that with the latest commits https://github.com/arturoc/openFrameworks/commit/c8d1f3f96d5ba73b42dfe85e6bbee8bd7c2699a8i on Pandaboard, OF compile fine! well done!

arturoc commented 11 years ago

i just changed armv7 to work with the GLFW window, it's just a temporary window class till i integrate the multiwindow branch but it works without problem.

kalwalt commented 11 years ago

i merge the new commits and i test immediately!

kalwalt commented 11 years ago

tested the last commits: OF lib compile, but not sure if it use glfw. I tested the OF_FULLSCREEN that worked in your elinuxGLFW branch , but i receive a sig fault.

(gdb) runb Undefined command: "runb". Try "help". (gdb) run Starting program: /home/walter/OF-glfwelinux/openFrameworks/examples/graphics/color/bin/color [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c] PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c] PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c]

Program received signal SIGSEGV, Segmentation fault. 0x000d418e in _glfwPlatformGetVideoMode () (gdb)

arturoc commented 11 years ago

not sure if fullscreen works properly in this branch, the current GLFW window is just a quick hack to test gl3/4 but once we merge the multiwindow version it should work without problem

kalwalt commented 11 years ago

ok no problem at all.i did just to test....

arturoc commented 11 years ago

this is ready to merge, i've tested on both pandaboard and rpi and it's working now. the programmable renderer seems way slower on rpi but not sure if it's something in the implementation or in the rpi drivers i'll take a look but i think we can merge it now, i still need to do a couple of changes and then we can send a PR to develop

kalwalt commented 11 years ago

wow! now fullscreen works on Pandaboard! that's cool, but some examples need to delete reference to ofAppGlutWindow as for example in main.cpp in colorsExtended example. I wll see if there are other issues.

kalwalt commented 11 years ago

lut filterExample works perfectly (out this branch don't works) and in the polylineBlobsExample i got 30-35 fps , shader Example need also some changes...

danzeeeman commented 11 years ago

ok cool I'll grab the newest and test it. What are you seeing on the Pi that is slow? Is it the actual rendering or the creation of the renderer?

On Sat, May 4, 2013 at 5:00 PM, Walter Perdan notifications@github.comwrote:

lut filterExample works perfectly (out this branch don't works) and in the polylineBlobsExample i got 30-35 fps , shader Example need also some changes...

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/pull/144#issuecomment-17441420 .

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

arturoc commented 11 years ago

@bakercp you were working on some changes to the makefiles right? do you want me to wait on that before merging this branch? other than that this is ready for sending a PR to the main repo

it would be useful to review all the examples and check that the main files are correct and don't reference ofAppGlutWindow

kalwalt commented 11 years ago

it would be useful to review all the examples and check that the main files are correct and don't reference ofAppGlutWindow

@arturoc i can take look at this. after i can send you a PR to your branch.

jvcleave commented 11 years ago

As this is the develop-raspberrypi branch I am cool to merge it as it stands.

Can we merge master with develop-raspberrypi just so we can point people to use it until we work out the examples/existing project transitions?

jvcleave commented 11 years ago

Hey the page is back:)

@arturoc I was getting the slowness as well - for instance my ofxOMXPlayer shader application only runs at 17fps with the ofProgrammableRenderer compared to 50ish with the ofGLES2Renderer