udvat at June 13th, 2007 03:23 — #1
I want to create an image in openGL where only black, gray and white colors are used to express the details. I tried RGB in openGL but many details are hidden. I think I have to implement HSV color model. Am I right?
I know how to convert from rgb to hsv but dont know how to use hsv in openGL. Please help me.
anubis at June 13th, 2007 03:31 — #2
What kind of detail is missing in RGB ? And why isn't GL_LUMINANCE enough ? GL_LUMINANCE uses a single value and internally replaces it for the RGB components of the resulting color value.
udvat at June 13th, 2007 04:16 — #3
In my image there are many branches, but many of these branches are hidden because of improper color setting. If I can make different shades in gray scale, I think these branches will be visible.
Searching through internet I saw that GL_Luminance is used with texture. But there is no texture in my code. Would u plz give me an example of using GL_LUMINANCE.
sol_hsa at June 13th, 2007 04:56 — #4
Ah, you want to implement some sort of grayscale dithering in OpenGL. That should be relatively easy using shaders, but no, there's no automatic mode for that.
dave_ at June 13th, 2007 05:33 — #5
Can you show us a screenshot of what you've got and a mock up of what you are trying to achieve?
udvat at June 13th, 2007 05:56 — #6
yes I can. but here is no option to paste image,I think.
dave_ at June 13th, 2007 06:05 — #7
or use the go advanced button
and you'll also need an image hosting service
thenut at June 13th, 2007 06:54 — #8
What's wrong with just using vertex colours or even the glMaterial() calls? That would be the easiest way to get your scene to look grayscale. You need to have a nicely detailed model for this to work though. Simply throwing in to few polygons and the flat shading will just kill the scene.
As Sol mentioned, if you have access to shaders you can maintain your RGB renders, but modify the pixel values in a fragment shader to simulate your grayscale. This is a more "portable" way for your code.