PDA

View Full Version : Bones + General



DarkShadow44
02-04-2010, 01:47 PM
Hi there !
I have two questions, so I made a double-topic :whistle:

1) How can I change AntiAliasing and Resolution at runtime ?

int iAttributes[] =
{
WGL_DRAW_TO_WINDOW_ARB,GL_TRUE,
WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
WGL_COLOR_BITS_ARB,24,
WGL_ALPHA_BITS_ARB,8,
WGL_DEPTH_BITS_ARB,16,
WGL_STENCIL_BITS_ARB,0,
WGL_DOUBLE_BUFFER_ARB,GL_TRUE,
WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
WGL_SAMPLES_ARB,levelAA,
0,0
};

// First We Check To See If We uCan Get A Pixel Format For 4 Samples
valid = wglChoosePixelFormatARB(hDC,iAttributes,fAttribute s,1,&pixelFormat,&numFormats);

I always destroy the current window and create a new one. But then all textures (with "glGenTextures()") are gone...
How can I avoid that ?

2) How can I deform my objects with bones ? If I have all neccessary values, how must I "use" them (rotation,scaling,transformation,...) ?

Thanks for your help in advance ;)

dletozeun
02-04-2010, 01:58 PM
1) I don't know

2) This is called skinning:
http://graphics.ucsd.edu/courses/cse169_w05/3-Skin.htm
http://www.okino.com/conv/skinning.htm

DarkShadow44
02-04-2010, 02:37 PM
wow, thanks for the fast reply ^^

I'd look at that tomorrow, but it looks interesting.
I thougt skinning means texturing... :eek:

Alfonse Reinheart
02-04-2010, 03:25 PM
1) How can I change AntiAliasing and Resolution at runtime ?

You don't. Once you have created your OpenGL context, the framebuffer is set. You must destroy your OpenGL context (and window) in order to create a new one.

overlay
02-04-2010, 04:44 PM
1) to avoid destruction of the OpenGL resources (textures,...) you can share them with another OpenGL context that you never destroy/recreate.

Dark Photon
02-04-2010, 05:25 PM
1) How can I change AntiAliasing and Resolution at runtime ?

You don't. Once you have created your OpenGL context, the framebuffer is set. You must destroy your OpenGL context (and window) in order to create a new one.

Well, one is render-to-FBO. That is, instead of deleting/creating a new window with the desired HW antialiasing, allocate a non-antialiased window at startup (that never needs changed), and then behind the scenes you can allocate FBO render targets with different antialiasing depending on the antialiasing config. Then you render to FBO instead of to the window. At the end of your frame, you downsample and copy the FBO contents to the main framebuffer and then call swapbuffers.

When you need to change AA configs, you merely delete/create a new FBO render target (all unbeknownst to the user) -- the main on-screen window doesn't need to change.

DarkShadow44
02-05-2010, 10:20 AM
1) How can I give a FBO Aliasliasing ?
But why do I have to downsample ?
And how do I copy the FBO contents to the main framebuffer ?

Sorry, but I dond't use FBO so much... :o

2) So which values do I exactly need to use scaling/rotation/location ? Only the matrix or do I need the roll value or lenght of my bone ?
And how do I have to deal with linked bones ?

Sorry, but I don't understand that...

DarkShadow44
02-06-2010, 09:43 AM
?

Alfonse Reinheart
02-06-2010, 12:33 PM
How can I give a FBO Aliasliasing ?
But why do I have to downsample ?
And how do I copy the FBO contents to the main framebuffer ?

The Wiki. Use it. (http://www.opengl.org/wiki/Framebuffer_Objects)

DarkShadow44
02-06-2010, 03:23 PM
Thx.

And the armature ?
I don't understand which values I need... and how to use them :o

Please help :o