Hallo,
ich wollte fragen, ob cColorBits den Alpha-Kanal einschließt.
Also wenn man cColorBits z.B. den Wert 32 zuweist, gilt dann folgendes (R:8Bit, G:8Bit, B:8Bit, A:8Bit) ?
Ich habe die MSDN Library und da steht etwas vom Ausschluss des Alpha-Kanals, wenn ich das richtig verstanden habe.
Also theoretisch kann man im Pixel-Format-Descriptor den Wert definieren, wie man ihn braucht (cRedBits, cGreenBits, cAlphaBits, ...). Ist IMO aber unnötig. Denn wieviel Bits jeder Wert intern hat wird von OpenGL gemenaged. Mann muss nur beim übergeben der Textur-Daten darauf achten, das man OpenGL mitteilt wie die Bits bei der Textur definiert sind. Den Rest macht OpenGL dann alleine...
_________________ Und was würdest Du tun, wenn Du wüsstest, dass morgen Dein letzter Tag auf dieser Erde ist?
Danke für die Antwort aber diese hilft mir nicht wirklich weiter.
Ich hätte schon gerne eine Antwort, die sich auf meine Frage bezieht und nicht ein neues Thema behandelt.
Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
Zitat:
cColorBits
Specifies the number of color bitplanes in each color buffer. For RGBA pixel types, it is the size of the color buffer excluding the alpha bitplanes. For color index pixels, it is the size of the color index buffer.
Das steht so in der Win-SDK-Hilfe von Windows, und da kannst du dir auch sicher sein dass es so ist. Wenn du also Alpha willst, musst du den eigentlicht selbst anfordern, aber ähnlich wie man bei einigen Grakas bei Anforderung von 24-Bit Tiefe gleich 8-Bit Stencil mitbekommt (=32 Bit =DWORD =Passende Datengrenzen) bekommst du im Normalfall bei ner Anforderung eines 24-Bit RGB-Farbpuffer auch gleich 8-Bit Alpha mit, aber darauf sollte man sich nicht unbedingt verlassen.
Danke Son of Satan.
Also ich möchte 8Bit für jeden Farbkanal + 8Bit für Alpha.
Wenn ich es richtig verstanden habe, muss ich dann folgendes tun:
cColorBits = 24
cAlphaBits = 8
Habe ich das so richtig verstanden?
Ob es nun unterstützt wird oder nicht, spielt jetzt erstmal keine Rolle.
Übrigens zur Info an alle.
Laut MSDN Library werden die ganzen cRedBits, cGreenBits, etc. nicht ausgewertet jeden falls nicht von ChoosePixelFormat.
cAlphaBits wird jedoch ausgewertet.
Das wird wohl den Vorschlag von SchodMC verpuffen lassen, sorry
//Edit: Der Alphakanal ist eigentlich auch ein Farbkanal. Und wenn ich 32 bestellt habe, dann habe ich eigentlich immer 8 Bit für den Alpha erhalten. Ich vermute mal das OpenGL das intern regelt.
MfG
IFlo
_________________ Danke an alle, die mir (und anderen) geholfen haben. So weit... ...so gut
Der Alphakanal ist eigentlich auch ein Farbkanal. Und wenn ich 32 bestellt habe, dann habe ich eigentlich immer 8 Bit für den Alpha erhalten. Ich vermute mal das OpenGL das intern regelt.
kann nicht ganz richtig sein, wenn du damit meinst, dass wenn ich cColorBits=32 schreibe folgendes definiere: R:8Bit, G:8Bit, B:8Bit, A:8Bit (RGBA).
Son of Satan hat ein Stück aus der MSDN Library zitiert und da steht, dass mit cColorBits nicht der Alpha-Wert angegeben werden soll, sondern nur die Anzahl der Bits für die 3 Farbkanäle RGB. Da steht ja
Zitat:
For RGBA pixel types, it is the size of the color buffer excluding the alpha bitplanes.
Ich hoffe, dass ich es richtig übersetzt habe (sinngemäß)
Ich habe in der MSDN Library unter ChoosePixelFormat nachgeschaut und da steht folgendes:
Zitat:
nSize = Specifies the size of the PIXELFORMATDESCRIPTOR data structure. Set this member to sizeof(PIXELFORMATDESCRIPTOR).
nVersion = Specifies the version number of the PIXELFORMATDESCRIPTOR data structure. Set this member to 1.
dwFlags = A set of bit flags that specify properties of the pixel buffer. You can combine the following bit flag constants by using bitwise-OR. If any of the following flags are set, the ChoosePixelFormat function attempts to match pixel formats that also have that flag or flags set. Otherwise, ChoosePixelFormat ignores that flag in the pixel formats:
If any of the following flags are set, ChoosePixelFormat attempts to match pixel formats that also have that flag or flags set. Otherwise, it attempts to match pixel formats without that flag set:
PFD_DOUBLEBUFFER PFD_STEREO
If the following flag is set, the function ignores the PFD_DOUBLEBUFFER flag in the pixel formats:
PFD_DOUBLEBUFFER_DONTCARE
If the following flag is set, the function ignores the PFD_STEREO flag in the pixel formats:
PFD_STEREO_DONTCARE
iPixelType = Specifies the type of pixel format for the function to consider: PFD_TYPE_RGBA PFD_TYPE_COLORINDEX
cColorBits = Zero or greater. cRedBits = Not used. cRedShift = Not used. cGreenBits = Not used. cGreenShift = Not used. cBlueBits = Not used. cBlueShift = Not used. cAlphaBits = Zero or greater. cAlphaShift = Not used. cAccumBits = Zero or greater. cAccumRedBits = Not used. cAccumGreenBits = Not used. cAccumBlueBits = Not used. cAccumAlphaBits = Not used. cDepthBits = Zero or greater. cStencilBits = Zero or greater. cAuxBuffers = Zero or greater.
iLayerType = Specifies one of the following layer type values: PFD_MAIN_PLANE PFD_OVERLAY_PLANE PFD_UNDERLAY_PLANE
bReserved = Not used. dwLayerMask = Not used. dwVisibleMask = Not used. dwDamageMask = Not used.
Wie man sieht, wird das Meiste nicht benötigt aber man kann für Alpha (cAlphaBits) was angeben.
Dann gehe ich davon aus, dass es wohl so sein wird, dass man die Bits für RGB in cColorBits und für den Alpha-Kanal in cAlphaBits angibt.
Mitglieder in diesem Forum: 0 Mitglieder und 6 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.