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

ofVboMesh / ofMesh drawing w/ texture coords fails (updated) #42

Closed bakercp closed 11 years ago

bakercp commented 11 years ago

terminate called after throwing an instance of 'Poco::SystemException' what(): System exception Aborted

---- above fixed with with #63 ---- issues with vbo remain (see below)

bakercp commented 11 years ago

This original exception was happening because easycam (which uses events) was failing. Easycam is now fixed, but the VBO is still failing.

bakercp commented 11 years ago

The program compiles and runs, but no mesh is visible in either ofMesh or ofVBOMesh mode. To get the program to run, I had to change skip = 1 to skip = 20.

kalwalt commented 11 years ago

hi @bakercp , if you set in draw() ofBackground(120); and comment out

img.bind() img.unbind()

you can see the geometry rendered (all black because without texture). but you have to move a bit the camera... i think the problem now is the texture binded. but i reserve to do other test with a light source to see how is rendered.

tested with the latest commits and GLES2.

bakercp commented 11 years ago

@kalwalt I just confirmed your findings regarding img.bind() / img.unbind() on the RPi. I'm going to write some simple tests to check texture binding. I'll post results here.

bakercp commented 11 years ago

Greets all. I tested ofVboMesh and ofMesh using simple examples (a single triangle) and was unable to bind an image, even after adding the tex coords to the mesh, etc. I also tried throwing some light on it with ofLight in GLES1 mode. When the textures were unbound, the mesh was illuminated correctly. When the texture was bound, just black.

Thus, I'm thinking that there may be some gles implementation problem in the of mesh code?

kalwalt commented 11 years ago

yes but ofBoxExample(and the multilightexample) works instead. Also this example has:

ofLogo.bind() ; ofBox(boxSize); ofLogo.unbind();

why this works good?

bakercp commented 11 years ago

@kalwalt that is a wonderful question :)

arturoc commented 11 years ago

i guess you are not using normalized tex coordinates? gles doesn't support arb textures so you need to use 0..1 tex coords. ofBox detects gles and does that. i guess all the examples that use textures will need some ifdefs

bakercp commented 11 years ago

@arturoc you're brilliant.

Fixed with 2ccffceeaba59fc2e4a94a0dc54964e8276cf919.