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.
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.
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.
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.
Can you show us a screenshot of what you've got and a mock up of what you are trying to achieve?
yes I can. but here is no option to paste image,I think.
or use the go advanced button
and you'll also need an image hosting service
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.