PDA

View Full Version : Multisampling & NV_render_to_texture



mfort
11-20-2003, 03:50 AM
Hi,
I need to render scene to texture using multisampling and then to use that texture in
non-multisampling context.

I'm not able to find any pixel format with
multisampling and render_to_texture support
at the same time.

glCopyTexSubImage2D cannot be used because
contexts with different pixel format cannot
be shared.

I'm using NVIDIA Fx 5800 with 52.16 drivers

Any idea?
Appreciate your help.

V-man
11-20-2003, 10:56 AM
RTT with a multisample p-buffer seems to be not supported on any card (unless someone knows different).

Duplicate your texture for each context. You probably have plenty of VRAM.

CWiC
11-20-2003, 10:26 PM
> glCopyTexSubImage2D cannot be used because
> contexts with different pixel format cannot
> be shared.

Definitely you can do glCopyTexSubImage2D from multisampled pbuffer to non-multisampling context.

mfort
11-21-2003, 01:59 AM
How can I duplicate texture for second context?

As far as I know NVidia doesn't support make_current_read extension.

Sharing texture objects among contexts is
posible only when both contexts have the same pixel format. Since multi sampling and non-multisampling buffers use different pixel format I cannot share them.

CWiC
11-21-2003, 10:33 AM
Try 'simple_pbuffer' example from nVidia SDK. Add 'samples=2' into pbuffer definition string and see the result - antialiased pbuffer will continue to work as texture for app. Sorry if this is not what you looking for, just this is as I understand your problem.

jwatte
11-21-2003, 08:54 PM
Why couldn't you "copy" the texture into the other context by just doing a wglShareLists()?

nystep
11-22-2003, 03:14 AM
it's strange that RTT with a multisampling p-buffer doesn't works, since that feature is avialable on direct3d and seems to works fine on a geForce2, according to:
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=06-19-2003&forum=iotd&id=-1

mfort
11-24-2003, 04:31 AM
All I need is to use that texture in NON-multisampling context.
I mean:
- generate texture using multisampling
- use texture without multisampling (for better frame rate)

Note:
glDisable(GL_MULTISAMPLE_...) in mutlisampling context doesn't help (see specification).

V-man
11-24-2003, 11:12 AM
>>>How can I duplicate texture for second context?<<<

On multisample context, render to framen buffer, copy it to a texture (I imagine this will be very slow).

Download to RAM via glGetTexImage

On non-multisample context, upload with glTexImage

>>>DX9a<<<

DX9a?
It uses stretchblit?
**** that!

OpenGL guy
11-24-2003, 05:40 PM
Originally posted by nystep:
it's strange that RTT with a multisampling p-buffer doesn't works, since that feature is avialable on direct3d and seems to works fine on a geForce2, according to:
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=06-19-2003&forum=iotd&id=-1
Actually, you can not do multisampling on a texture in D3D (CreateTexture lacks a multisamplequality field, unlike CreateRenderTarget). DX9.0a added the ability to copy a multisampled render target to a texture (DX9.0 used to refuse to do this, even though there's no real problem with it).