Pbuffertest - alpha problem

Started by cgt, February 09, 2006, 21:53:19

Previous topic - Next topic

cgt

Hi,

I would like to use Pbuffer with alpha bits. If I try the pbuffertest example, and modify the pbuffer creation to:

pbuffer = new Pbuffer(512, 512, new PixelFormat(8,24,1), null, null);

I get:
org.lwjgl.LWJGLException: Could not find a valid pixel format
   at org.lwjgl.opengl.Win32PbufferPeerInfo.nCreate(Native Method)
   at org.lwjgl.opengl.Win32PbufferPeerInfo.<init>(Win32PbufferPeerInfo.java:47)
   at org.lwjgl.opengl.Win32Display.createPbuffer(Win32Display.java:167)
   at org.lwjgl.opengl.Pbuffer.createPbuffer(Pbuffer.java:201)
   at org.lwjgl.opengl.Pbuffer.<init>(Pbuffer.java:183)
.....


I've done some c-coding with the above settings, so the graphic card does support the setting (nvidia geforce 4 440 go). I've been through the source code, and I don't see any obvious differences in picking the pixel format. The only way I can make the sample run is to set the first parameter (alpha) to 0.

Any ideas or am I misunderstanding something here ? Could somebody maybe just confirm that the above change is feasible ?

Best Regards Christian

Fool Running

Have you tried setting the stencil to something other than 1?
I used to make a Pbuffer (before I found out about GL_EXT_framebuffer_object) with a pixel format 32bbp, 8 alpha, 24 color, 8 stencil, 0 sample and it worked for me.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

cgt

Thanks. Its the same error.
Also this one fails, and again changing the alpha value to 0, makes the program happy.

pbuffer = new Pbuffer(512, 512, new PixelFormat(0,8,24,0,0), null, null);
org.lwjgl.LWJGLException: Could not find a valid pixel format

Fool Running

Well, I'm out of ideas  :lol:
Someone else can chime in...
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

cgt

I've tried on a Intel Grahpics card, where it works. It must be a device driver problem. This is also indicated by the following stacktrace which is generated when the follwing line is active:

GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0, 0, 512, 512, 0);



Stack: [0x00030000,0x00070000),  sp=0x0006f49c,  free space=253k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x0faaf058

[error occurred during error reporting, step 120, id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.opengl.GL11.nglCopyTexImage2D(IIIIIIIIJ)V+0
j  org.lwjgl.opengl.GL11.glCopyTexImage2D(IIIIIIII)V+27
j  test.PbufferTest.render()V+177
j  test.PbufferTest.mainLoop()V+18

Fool Running

Have you tried with texture sizes below 512?
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

cgt

Thanks,

I tried 256x256, still the same problem(s). I have tried updating drivers, though Dell nvidia driver seems ancient (and the drivers from Nvidia will not recognize my card)

I beleive my solution will be to do a pbuffer library for the purpose ( I have some simple jni code to create pbuffer that works; also with this graphic card).

spasi

You're trying to create a Pbuffer with zero bpp. Try a more standard pixel format like:

new Pbuffer(512, 512, new PixelFormat(24, 8, 24, 0, 0), null, null);

cgt

I actually did the zero bpp, as this falls back to the default setting of the screen (as I understand the underlying code. (32 in my case)). However I just tried your setting, which also fails.

But this is really strange; I only see the demo, if I also sets the bpp = 0. Setting bpp to either of  8,16,24 makes the demo fail.

That is the only way I can make PbufferTest run, is by setting both bpp and alpha to zero values.