Changing multisampling samples number real-time?

Hello people,

I have managed to implement multisampling under windows in my project. It is pretty straightforward and the results are indeed spectacular.

But I would like to ask a question. I have some form of text rendered which I need to make as clear and sharp as possible. So the biggest the number of samples, the better it is. I tried with 4x and 16x and there is a big difference in sharpness. Of course 16 samples is quite heavy for everything else. But if it is only for text, no matter how much it is, even if there is whole pages of it, performance won’t be hampered.

So the question is can I change the number of samples in real time somehow? Use 16x when rendering text and then use less samples for everything else? Or I would have to destroy the window and recreate it with a new pfd?

You could try just glDisable(GL_MULTISAMPLE) for non-tex, but you will need to measure whether this is as fast as rendering to non-multisampled framebuffer or not.

Alternatively you can render your text to multisampled fbo.

Yeah I would have to try that to compare speed but still the non-text won’t be multisampled.

calling glDisable(GL_MULTISAMPLE) will completely disable multisampling. What about just using a smaller number of samples for everything else but text?

I have not used fbos yet so I am not familiar with their use. Can you define different samples for each frame buffer? If so that would suit my needs perfectly I guess.

Dont worry, they are very simple, and yes, you can make each fbo (its attachments) with desired samples count.
You will need GL3.0 for multisampled renderbuffers, and/or GL3.2 for multisampled textures (or appropriate extensions).

Hmm so they are not supported by the latest openGL ES (2.0?) yet? I will have to think of a workaround for the mobile version then. Thanks kyle_ that sounds very interesting! I will read on fbos then.

Hmm so they are not supported by the latest openGL ES (2.0?) yet?

Depending on the hardware, it may be available in extension form.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.