0
101 Jun 13, 2007 at 07:23

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.

#### 7 Replies

0
101 Jun 13, 2007 at 07:31

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.

0
101 Jun 13, 2007 at 08:16

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.

0
118 Jun 13, 2007 at 08:56

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.

0
101 Jun 13, 2007 at 09:33

Can you show us a screenshot of what you’ve got and a mock up of what you are trying to achieve?

0
101 Jun 13, 2007 at 09:56

yes I can. but here is no option to paste image,I think.

0
101 Jun 13, 2007 at 10:05

This:

[img]http://www.devmaster.net/logo.gif[/img]


displays this:

or use the go advanced button

and you’ll also need an image hosting service

0
178 Jun 13, 2007 at 10:54

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.