Hi all,
I am starting with OpenGL. The RGB model gives us 256 grey level (or
8 bit). The function call "glDrawPixels" can specify the format of data
as "GL_COLOR_INDEX", "GL_RGBA" and other. But apparently there is no
way to specify that the pixel data is 10 bit grey. Does anyone know how
to do that?
|
|
0
|
|
|
|
Reply
|
ccwork (22)
|
2/21/2005 7:16:16 AM |
|
ccwork wrote:
> Hi all,
> I am starting with OpenGL. The RGB model gives us 256 grey level (or
> 8 bit). The function call "glDrawPixels" can specify the format of data
> as "GL_COLOR_INDEX", "GL_RGBA" and other. But apparently there is no
> way to specify that the pixel data is 10 bit grey. Does anyone know how
> to do that?
Well, depending on what graphics card you have, you can use another mode
with more precision, though not exactly 10 bits. There are e.g. modes with
12bit or 16bit integer or 32bit floating point. Have a look at mode names
beginning with INTENSITY or LUMINANCE.
|
|
0
|
|
|
|
Reply
|
Rolf
|
2/21/2005 11:13:14 AM
|
|
"ccwork" <ccwork@hotmail.com> wrote in message
news:1108970176.739923.43030@f14g2000cwb.googlegroups.com...
> Hi all,
> I am starting with OpenGL. The RGB model gives us 256 grey level (or
> 8 bit). The function call "glDrawPixels" can specify the format of data
> as "GL_COLOR_INDEX", "GL_RGBA" and other. But apparently there is no
> way to specify that the pixel data is 10 bit grey. Does anyone know how
> to do that?
>
First, try doing a glGet for GL_RED_BITS. If it comes back as 8, you lose.
Unless your frame buffer has > 8 bits of R,G & B, you won't get any more
than 256 shades of grey. You may need to try to explicitly ask for more
bits in however you set up your framebuffer allocation (PixelFormat in
Windows),
but many consumer cards don't go beyond 8-bits.
The RGB model per se can give you any number of bits of color depth; it maps
the
incoming data to the bits available in the frame buffer, so GL_RGBA, or
GL_LUMINANCE can do it with a data type that inherently has > 8 bits,
(e.g., short, float, or one of the special formats like
GL_UNSIGNED_INT_10_10_10_2).
-jbw
|
|
0
|
|
|
|
Reply
|
JB
|
2/22/2005 1:00:59 AM
|
|
JB West wrote:
> "ccwork" <ccwork@hotmail.com> wrote in message
> news:1108970176.739923.43030@f14g2000cwb.googlegroups.com...
> > Hi all,
> > I am starting with OpenGL. The RGB model gives us 256 grey level
(or
> > 8 bit). The function call "glDrawPixels" can specify the format of
data
> > as "GL_COLOR_INDEX", "GL_RGBA" and other. But apparently there is
no
> > way to specify that the pixel data is 10 bit grey. Does anyone know
how
> > to do that?
> >
>
> First, try doing a glGet for GL_RED_BITS. If it comes back as 8, you
lose.
> Unless your frame buffer has > 8 bits of R,G & B, you won't get any
more
> than 256 shades of grey. You may need to try to explicitly ask for
more
> bits in however you set up your framebuffer allocation (PixelFormat
in
> Windows),
> but many consumer cards don't go beyond 8-bits.
>
> The RGB model per se can give you any number of bits of color depth;
it maps
> the
> incoming data to the bits available in the frame buffer, so GL_RGBA,
or
> GL_LUMINANCE can do it with a data type that inherently has > 8 bits,
> (e.g., short, float, or one of the special formats like
> GL_UNSIGNED_INT_10_10_10_2).
How to define my own format?
|
|
0
|
|
|
|
Reply
|
ccwork
|
2/22/2005 1:18:47 AM
|
|
ccwork wrote:
> How to define my own format?
You cannot define your own one. You can only choose from a list
|
|
0
|
|
|
|
Reply
|
Rolf
|
2/22/2005 1:24:52 AM
|
|
Rolf Magnus wrote:
> ccwork wrote:
>
> > How to define my own format?
>
> You cannot define your own one. You can only choose from a list
The standard API reference (from web) does not list
"GL_UNSIGNED_INT_10_10_10_2" as one of the format available as
suggested by JB West.
|
|
0
|
|
|
|
Reply
|
ccwork
|
2/22/2005 3:06:55 AM
|
|
ccwork wrote:
>
> Rolf Magnus wrote:
>> ccwork wrote:
>>
>> > How to define my own format?
>>
>> You cannot define your own one. You can only choose from a list
>
> The standard API reference (from web) does not list
> "GL_UNSIGNED_INT_10_10_10_2" as one of the format available as
> suggested by JB West.
The OpenGL 1.5 spec does list it.
|
|
0
|
|
|
|
Reply
|
Rolf
|
2/22/2005 10:39:31 AM
|
|
ccwork wrote:
> Rolf Magnus wrote:
>
>>ccwork wrote:
>>
>>
>>> How to define my own format?
>>
Get yourself a big SGI machine... :-)
>>You cannot define your own one. You can only choose from a list
>
> The standard API reference (from web) does not list
> "GL_UNSIGNED_INT_10_10_10_2" as one of the format available as
> suggested by JB West.
>
Maybe you need to download the latest header file.
Get "glext.h" here:
http://oss.sgi.com/projects/ogl-sample/registry/
Don't get your hopes up though. In the PC world
I think only Matrox Parhelia cards can do 10 bit
color.
glTexImage2d(GL_PROXY_TEXTURE_2D,...) can be used
to try out different formats to see if they work
on your card or not.
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.
|
|
0
|
|
|
|
Reply
|
fungus
|
2/22/2005 11:36:44 AM
|
|
Rolf Magnus wrote:
> ccwork wrote:
>
> >
> > Rolf Magnus wrote:
> >> ccwork wrote:
> >>
> >> > How to define my own format?
> >>
> >> You cannot define your own one. You can only choose from a list
> >
> > The standard API reference (from web) does not list
> > "GL_UNSIGNED_INT_10_10_10_2" as one of the format available as
> > suggested by JB West.
>
> The OpenGL 1.5 spec does list it.
|
|
0
|
|
|
|
Reply
|
manuscheung
|
2/24/2005 3:41:28 AM
|
|
Hi,
I am using Visual C++ for development and I think the bundled openGL
is 1.1 version. If I want to use OpenGL 1.5 then where can I get this
library? And will my program still portable to every Windows platform
independent of hardware?
Rolf Magnus wrote:
> ccwork wrote:
>
> >
> > Rolf Magnus wrote:
> >> ccwork wrote:
> >>
> >> > How to define my own format?
> >>
> >> You cannot define your own one. You can only choose from a list
> >
> > The standard API reference (from web) does not list
> > "GL_UNSIGNED_INT_10_10_10_2" as one of the format available as
> > suggested by JB West.
>
> The OpenGL 1.5 spec does list it.
|
|
0
|
|
|
|
Reply
|
ccwork
|
2/25/2005 2:34:33 AM
|
|
ccwork wrote:
> Hi,
> I am using Visual C++ for development and I think the bundled openGL
> is 1.1 version. If I want to use OpenGL 1.5 then where can I get this
> library?
>
There is no OpenGL 1.6 library file.
You have to access the new functions via the OpenGL
extension mechanism, ie. wglGetProcAddress() on
Windows.
> And will my program still portable to every Windows platform
> independent of hardware?
>
Of course. That's the advantage of the extension
mechanism - everybody has the same opengl32.dll
on their machine.
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.
|
|
0
|
|
|
|
Reply
|
fungus
|
2/25/2005 9:18:05 AM
|
|
fungus wrote:
> ccwork wrote:
>> Hi, I am using Visual C++ for development and I think the bundled
>> openGL is 1.1 version. If I want to use OpenGL 1.5 then where can I
>> get this library?
>
> There is no OpenGL 1.6 library file.
No OpenGL 1.5 library either ;) - except of course on linux...
> You have to access the new functions via the OpenGL extension
> mechanism, ie. wglGetProcAddress() on Windows.
To do this easily, use an extension-wrapper like glew or glee (google-them).
>> And will my program still portable to every Windows platform
>> independent of hardware?
>
> Of course. That's the advantage of the extension mechanism -
> everybody has the same opengl32.dll on their machine.
Yes, I thank Microsoft on a daily basis for giving me the opportunity to
use opengl-extensions. Supplying an opengl32.dll with my application
really would be an administrative task entirely beyond my logistic
abilities.
:p
\\Mikkel Gjoel
|
|
0
|
|
|
|
Reply
|
ISO
|
2/25/2005 1:26:24 PM
|
|
Mikkel Gj�l wrote:
>> There is no OpenGL 1.6 library file.
>
>
> No OpenGL 1.5 library either ;) - except of course on linux...
>
I blame my cat for walking on the keys when I type.
>> That's the advantage of the extension mechanism -
>> everybody has the same opengl32.dll on their machine.
>
>
> Yes, I thank Microsoft on a daily basis for giving me the opportunity to
> use opengl-extensions. Supplying an opengl32.dll with my application
> really would be an administrative task entirely beyond my logistic
> abilities.
>
That just pushes the problem down a layer. If you do
it that way then you have to peek at the driver/card
to see if it actually supported the extensions.
I'm not sure that's an advantage over the current
system...
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.
Governments, like diapers, should be changed often,
and for the same reason.
|
|
0
|
|
|
|
Reply
|
fungus
|
2/25/2005 1:48:30 PM
|
|
fungus wrote:
> ccwork wrote:
>> Hi,
>> I am using Visual C++ for development and I think the bundled openGL
>> is 1.1 version. If I want to use OpenGL 1.5 then where can I get this
>> library?
> >
>
> There is no OpenGL 1.6 library file.
>
> You have to access the new functions via the OpenGL
> extension mechanism, ie. wglGetProcAddress() on
> Windows.
However, GL_UNSIGNED_INT_10_10_10_2 is not a function. It's a macro that
would be defined in GL/gl.h or GL/glext.h (or GL/glew.h if you're using
glew). Therefore, a recent version of gl.h or glext.h would be enough to
get it to compile. Of course, you still have to test at runtime whether the
format is really supported by the GL implementation.
Btw: I don't know in which version of OpenGL that format was introduced. I
just know that it's there in 1.5.
|
|
0
|
|
|
|
Reply
|
Rolf
|
2/25/2005 6:03:42 PM
|
|
"Rolf Magnus" <ramagnus@t-online.de> wrote in message
news:cvnp15$ill$00$1@news.t-online.com...
> fungus wrote:
>
> > ccwork wrote:
> >> Hi,
> >> I am using Visual C++ for development and I think the bundled openGL
> >> is 1.1 version. If I want to use OpenGL 1.5 then where can I get this
> >> library?
> > >
> >
> > There is no OpenGL 1.6 library file.
> >
> > You have to access the new functions via the OpenGL
> > extension mechanism, ie. wglGetProcAddress() on
> > Windows.
>
> However, GL_UNSIGNED_INT_10_10_10_2 is not a function. It's a macro that
> would be defined in GL/gl.h or GL/glext.h (or GL/glew.h if you're using
> glew). Therefore, a recent version of gl.h or glext.h would be enough to
> get it to compile. Of course, you still have to test at runtime whether
the
> format is really supported by the GL implementation.
> Btw: I don't know in which version of OpenGL that format was introduced. I
> just know that it's there in 1.5.
>
Note that this is just an internal storage format. GL_SHORT would work just
as well
for 10-bit.
jbw
|
|
0
|
|
|
|
Reply
|
JB
|
2/26/2005 1:18:51 AM
|
|
|
14 Replies
348 Views
(page loaded in 0.375 seconds)
|