• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Ro_Akira

Pixel Formats OGL

7 posts in this topic

Hi, I''m trying to get a list of pixel formats that my OpenGL app can render to. I''m basically going through describe pixel format handing it an ever increasing pixel format index and discarding modes I don''t want to consider (like bpp<16, no PDF_SUPPORT_OPENGL et cetera). What I''m not finding 100% clear from the docs is whether PDF_GENERIC_FORMAT and PDF_GENERIC_ACCELERATED are mutually exclusive. I took these meanings from the presence of the flags: PDF_GENERIC_FORMAT only = Only supported by the generic (software) implementation PDF_GENERIC_ACCELERATED = Only supported by the hardware) implementation PDF_GENERIC_FORMAT & PDF_GENERIC_ACCELERATED = Supported by both Is this the case? http://www.opengl.org/developers/faqs/technical/mswindows.htm says "...If PFD_GENERIC_ACCELERATED is clear and PFD_GENERIC_FORMAT is set, then the pixel format is only supported by the generic implementation. Hardware acceleration is not possible for this format..." It also says above that, a bit... "...Any format with the PFD_GENERIC_FORMAT attribute bit set will not be hardware accelerated..." The later statement seems to make PFD_GENERIC_ACCELERATED redundant as regards checking for hardware acceleration... Thanks, Ro_Akira
0

Share this post


Link to post
Share on other sites

Hi again,

A little more background as to why I''m inquiring about this:

This is the filtering criteria for my list of formats...

if ((pfd.cColorBits >= 16) && (pfd.cDepthBits > 0) &&
((pfd.dwFlags&PFD_DRAW_TO_WINDOW) == PFD_DRAW_TO_WINDOW) &&
((pfd.dwFlags&PFD_DOUBLEBUFFER) == PFD_DOUBLEBUFFER) &&
((pfd.dwFlags&PFD_SUPPORT_OPENGL) == PFD_SUPPORT_OPENGL) &&
!((pfd.dwFlags&PFD_GENERIC_FORMAT) == PFD_GENERIC_FORMAT))

...and below are results in this list. I''ve changed the order and grouped them into two groups. The first is the 32bit colour 0bit alpha group, and the second is the 24bit colour 8bit alpha group. I''m doing this on Geforce3 40.19 reference drivers.

There''s a few questions I have:
1) Why are there some apparently identical formats e.g. 4 and 10? (This is really just as a matter of interest - can always just remove duplicates)
2) Where''s my 16-bit colour modes?
3) I was using the diagnostic tool, Quake3 and it claims to be using ''mode 4'' whether it''s using 16-bit or 32-bit colour. Where''s it getting it''s 16-bit pixel formats from?

DescribePixelFormat...
Pixel format : 4
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 32
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 0
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 0
Alpha bits : 0
Z buffer bits : 24
Stencil buffer bits : 0
DescribePixelFormat...
Pixel format : 10
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 32
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 0
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 0
Alpha bits : 0
Z buffer bits : 24
Stencil buffer bits : 0
DescribePixelFormat...
Pixel format : 6
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 32
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 0
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 0
Alpha bits : 0
Z buffer bits : 24
Stencil buffer bits : 8
DescribePixelFormat...
Pixel format : 12
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 32
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 0
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 0
Alpha bits : 0
Z buffer bits : 24
Stencil buffer bits : 8

DescribePixelFormat...
Pixel format : 5
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 24
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 8
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 24
Alpha bits : 8
Z buffer bits : 24
Stencil buffer bits : 0
DescribePixelFormat...
Pixel format : 11
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 24
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 8
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 24
Alpha bits : 8
Z buffer bits : 24
Stencil buffer bits : 0
DescribePixelFormat...
Pixel format : 7
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 24
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 8
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 24
Alpha bits : 8
Z buffer bits : 24
Stencil buffer bits : 8
DescribePixelFormat...
Pixel format : 13
PFD_SUPPORT_OPENGL : Yes
PFD_GENERIC_ACCELERATED : No
PFD_SWAP_LAYER_BUFFERS : No
PFD_SUPPORT_GDI : No
PFD_DRAW_TO_BITMAP : No
PFD_GENERIC_FORMAT : No
PFD_TYPE_RGBA : Yes
Colour bits : 24
Red bits : 8
Green bits : 8
Blue bits : 8
Alpha bits : 8
Red position : 16
Green position : 8
Blue position : 0
Alpha position : 24
Alpha bits : 8
Z buffer bits : 24
Stencil buffer bits : 8

Thanks,
Ro_Akira
0

Share this post


Link to post
Share on other sites
The way I see it:

PFD_GENERIC_FORMAT only = Software
PFD_GENERIC_ACCELERATED only = Accelerated through MCD
Neither = Accelerated through ICD


And your questions:

1. Maybe one of them has an accumulation buffer? Maybe one has PFD_SWAP_COPY and the other has PFD_SWAP_EXCHANGE?
2. Set your screen to 16 bit color.
3. See 2


---
Visit Da Shovvkejs.
0

Share this post


Link to post
Share on other sites
Thanks for the reply.
You're right about the PDF_GENERIC_FORMAT & PDF_GENERIC_ACCELERATED flags. I think I should aim for just ICD support.

1. I can't find any flags that are different (including PFD_SWAP_COPY and PFD_SWAP_EXCHANGE) and I'm filtering out accumulation buffer bit information for any mode that has an accumlation buffer bits != 64 (I was just tired of seeing it).
2. You're right about the need to change to 16-bit colour desktop to get the 16-bit modes. Is this why Half-Life likes one to change to a 16-bit desktop before starting?
3. I was thinking that each pixel format was 'set in stone', like mode 4 is always 32-bit with a certain z-buffer etc. Obviously not...

I have another question related to pixel formats now.

// Only want 16-bit+ colour formats
if ((pfd.cColorBits >= 16) &&

// We want a depth buffer
(pfd.cDepthBits > 0) &&

// We want to be able to draw to a window((pfd.dwFlags&PFD_DRAW_TO_WINDOW) == PFD_DRAW_TO_WINDOW) &&

// We want double buffering
((pfd.dwFlags&PFD_DOUBLEBUFFER) == PFD_DOUBLEBUFFER) &&

// We want OpenGL support
((pfd.dwFlags&PFD_SUPPORT_OPENGL) == PFD_SUPPORT_OPENGL) &&

// Only bother with ICD (no MCD or software)
!((pfd.dwFlags&PFD_GENERIC_FORMAT) == PFD_GENERIC_FORMAT) &&
!((pfd.dwFlags&PFD_GENERIC_ACCELERATED) == PFD_GENERIC_ACCELERATED))

The above are the criteria I now use to filter pixel formats. The thing is, according to the DirectX Caps Viewer, I should have these modes:

Depth buffer bits | Stencil Buffer bits
24 8
24 0
16 x

With DescribePixelFormat (...) I only get:

Depth buffer bits | Stencil Buffer bits
24 8
24 0

Where's my 16-bit z-buffer gone? I've tried 16-bit and 32-bit colours modes (not that it should make a difference). Geforce3 64MB is the card, 41.09 are the reference drivers.

Thanks,
Ro_Akira

[edited by - Ro_Akira on January 29, 2003 1:03:12 AM]
0

Share this post


Link to post
Share on other sites
1. I dunno, they should be different in some way (I think). Try the memcmp function on them to see if they're totally equal.

16 bit zbuffer is uncommon on nvidia hardware (maybe on others too, I only have my gf3 as reference). I don't think I have any hardware accelerated opengl supporting pixelformat with 16 bit zbuffer.

(edit because I'm stupid)

---
Visit Da Shovvkejs.

[edited by - TheSalmon on January 29, 2003 12:15:47 PM]
0

Share this post


Link to post
Share on other sites
Thanks for the reply.

1. Well I''ve got that sorted. Due to a copy and paste, I was was trying to do ((pfd.iPixelType&PFD_SWAP_COPY) == PFD_SWAP_COPY), which wasn''t going to work was it?! It turns out PixelFormat4 has PFD_SWAP_EXCHANGE and PixelFormat10 has PFD_SWAP_COPY. I think I should have a preference for modes with PFD_SWAP_EXCHANGE.

On the 16-bit Z-Buffer front, I saw this page : http://developer.nvidia.com/view.asp?IO=geforce3_faq.

Answer22 seems to suggest that the card does support a 16-bit Z-Buffer. However, it does mention in Answer32 things like D24X8 which is Direct3D speak for 24-bit depth buffer, no stencil.

What I''m saying is that maybe it''s just that the OpenGL drivers, or maybe just the version of the drivers I''m using now (41.09 reference), don''t support it. As always, one is at the mercy of what the drivers tell you is on the card. I''ll try some other/earlier drivers, and see what they tell me...

Thanks,
Ro_Akira
0

Share this post


Link to post
Share on other sites
quote:
Original post by Ro_Akira
On the 16-bit Z-Buffer front, I saw this page : http://developer.nvidia.com/view.asp?IO=geforce3_faq.

Answer22 seems to suggest that the card does support a 16-bit Z-Buffer. However, it does mention in Answer32 things like D24X8 which is Direct3D speak for 24-bit depth buffer, no stencil.

What I''m saying is that maybe it''s just that the OpenGL drivers, or maybe just the version of the drivers I''m using now (41.09 reference), don''t support it. As always, one is at the mercy of what the drivers tell you is on the card. I''ll try some other/earlier drivers, and see what they tell me...

Thanks,
Ro_Akira


Yeah, I could be wrong. Not that it matters to me, 24 > 16

---
Visit Da Shovvkejs.
0

Share this post


Link to post
Share on other sites
i didnt read the whole post but

PFD_GENERIC_FORMAT only = Software
PFD_GENERIC_ACCELERATED only = Accelerated through MCD
Neither = Accelerated through ICD

if either of the first two flags are set then u have software ie PFD_GENERIC_ACCELERATED is not accelerated.
the only way u have true hardware acceleration is if NEITHER are set.

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
0

Share this post


Link to post
Share on other sites