Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofFbo does not support GL_LUMINANCE #2952

Open
julapy opened this issue Apr 27, 2014 · 7 comments
Open

ofFbo does not support GL_LUMINANCE #2952

julapy opened this issue Apr 27, 2014 · 7 comments

Comments

@julapy
Copy link
Member

julapy commented Apr 27, 2014

this is issue has been discussed a little on the forum,
http://forum.openframeworks.cc/t/offbo-supported-colour-modes/10136

@tgfrerer
Copy link
Member

Afaik GL_LUMINANCE is deprecated with modem OpenGL. Is it possible to use GL_RED instead?

This should bind one channel - it's what we do internally for rendering grayscale images in the programmable renderer pipeline.

typed on tocuh

On 27 Apr 2014, at 01:55, lukasz karluk notifications@github.com wrote:

this is issue has been discussed a little on the forum,
http://forum.openframeworks.cc/t/offbo-supported-colour-modes/10136


Reply to this email directly or view it on GitHub.

@julapy
Copy link
Member Author

julapy commented Apr 27, 2014

hey @tgfrerer,

setting up the fbo using GL_RED,
meshFbo->allocate(meshTexture->getWidth(), meshTexture->getHeight(), GL_RED);
turns the texture red, funnily enough :)

not sure how this would then be rendered out to greyscale?

also, GL_RED is not supported in ES1
but ES2 does have GL_RED_EXT as an extension.
think a lot of people still use ES1, i actually find it faster then the OF ES2 implementation.
so it would still be good to keep support for GL_LUMINANCE.

@tgfrerer
Copy link
Member

You can map the red channel to all three RGB channels on the shader to render the texture grayscale again =)

E.g.:

```glFragColor = vec4 ( tex.rrr, 1.0f);```

I agree, luminance should be supported for ES1, but maybe marked deprecated already, so that people can prepare for further GL versions.

I'm curious to hear where the performance bottlenecks are on iOS ES2 & oFGLProgrammableRenderer. I believe we are nowadays getting almost the same frame rates on raspberry pi, with most of the performance lag there due to the cost of doing the matrix math on the CPU.

typed on tocuh

On 27 Apr 2014, at 03:16, lukasz karluk notifications@github.com wrote:

hey @tgfrerer,

setting up the fbo using GL_RED,
meshFbo->allocate(meshTexture->getWidth(), meshTexture->getHeight(), GL_RED);
turns the texture red, funnily enough :)

not sure how this would then be rendered out to greyscale?

also, GL_RED is not supported in ES1
but ES2 does have GL_RED_EXT as an extension.
think a lot of people still use ES1, i actually find it faster then the OF ES2 implementation.
so it would still be good to keep support for GL_LUMINANCE.


Reply to this email directly or view it on GitHub.

@julapy
Copy link
Member Author

julapy commented Apr 27, 2014

ah yeah, doing the color translation on a shader makes sense.

i haven't looked to deep into it but just noticed the performance lag when working on different projects.
xcode has some really nice opengl profiling tools for iOS, just need to find some time to have proper look into it.

@joshuajnoble
Copy link
Contributor

I think in this case we want GL_R8 (or R16 in the case of a true depth texture), no? I ran into this on the Kinect common bridge.

@arturoc
Copy link
Member

arturoc commented Apr 28, 2014

GL_R8 is not supported on GLES, sometimes GL_RED works but not on all devices (at least on android) not even with GLES2 where GL_LUMINANCE is still supported so i guess we should fix ofFbo to work with GL_LUMINANCE

@joshuajnoble
Copy link
Contributor

Oops, that's GLES3 not 2. That'll teach me.

On Apr 28, 2014, at 7:58, arturo notifications@github.com wrote:

GL_R8 is not supported on GLES, sometimes GL_RED works but not on all devices (at least on android) not even with GLES2 where GL_LUMINANCE is still supported so i guess we should fix ofFbo to work with GL_LUMINANCE


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants