Variables for the PixelFormat constructure

Started by poo2thegeek, November 03, 2013, 15:51:53

Previous topic - Next topic

poo2thegeek

After thinking that some graphics in my program looked too pixelly, I google info on anti aliasing for lwjgl. I cam across the simple method of using Display.create(PixelFormat) when creating my Display rather than just Display.create().
From the LWJGl API I have found the following information about PixelFormat constructors:
PixelFormat(int alpha, int depth, int stencil)
PixelFormat(int alpha, int depth, int stencil, int samples)
PixelFormat(int bpp, int alpha, int depth, int stencil, int samples)
PixelFormat(int bpp, int alpha, int depth, int stencil, int samples, int num_aux_buffers, int accum_bpp, int accum_alpha, boolean stereo)
PixelFormat(int bpp, int alpha, int depth, int stencil, int samples, int num_aux_buffers, int accum_bpp, int accum_alpha, boolean stereo, boolean floating_point)

But I have no idea what these differ ant variables are! I have tried to guess by changing their values and seeing what difference it makes, but my graphics aren't advanced enough for me to notice much difference. So what do these variables mean?

Cornix

I am no expert but I would guess the following:

alpha       - Bits used to store alpha information
depth       - Bits used to store depth buffer information
stencil       - Bits used to store stencil buffer information
bpp          - "Bits per pixel" used to store RGB
samples       - Number of samplers in multi-sampling mode
num_aux_buffers    - Number of auxiliary buffers
accum_bpp    - Bits per pixel in the accumulation buffer
accum_alpha    - Bits used to store alpha in the accumulation buffer

stereo       - I have no idea
floating_point    - I have no idea


You can read about the various buffers and their uses here:
http://www.glprogramming.com/red/chapter10.html

poo2thegeek

Thanks for the reply. But I meant more about how each of the variables effect the Display. Like, for example, if you go on a game you can normally select multiple of 2 'anti aliasing' (2*,4*,8*,16*). But which of the variables decides this number (aliasing bit?)

Cornix

Samples is the number of samplers to use when multisampling. Its pretty straight forward.

You should also do this:
GLContext.getCapabilities().GL_ARB_multisample;

to check if multisampling is possible, and you should query the max number of samplers possible:
GL11.glGetInteger(GL30.GL_MAX_SAMPLES);