Anti aliasing question

I want to enable it for an offscreen renderer (only), could someone please tell me how? I can’t seem to find the setting.

Also does it work on buffers directly? I’m not rendering to a texture, just to a buffer. Btw I’m not looking for great quality, any kind of fast supersampling would do. 2x is enough.


When creating the viewport here is one paramter taht allows you to set the amount of sampling.

I suggest to use FXAA instead however, as it looks better and is faster.

1 Like

Yeah FXAA is the way to go IMO.

But maybe you can’t really create a viewport? how do you render your offscreen texture?

1 Like

thanks! yes i found it and it works. kept looking at the renderer etc. before. :slight_smile:

edit: I found it in the FrameBuffer constructor FrameBuffer(width,height,numSamples), and samples were set to 1 before (but I forgot about that). This is exactly what i was looking for.

I still suggest to use a FXAA filter on the viewport instead, you should at least try it.


Not sure its the best approach really, but I just do it like its done in Application - set up a render manager, a camera, a viewport etc.

The viewport i create from renderManager.createMainView(…). Its the only view.

When i do the rendering I just do a loop where i move the camera around, update geometric states and do:

manager.render(0, true);

renderer.readFrameBuffer(offBuffer, outBuf);

Then put all those buffers together. I have to modify them a little to make the render images tile in the final texture tho. Its like a grid of 4x4 rendered images in one texture.

Btw I tried using renderViewPortRaw instead but that got me an empty texture. Not sure why.


Ah ok. I thought I did that by changing the samples number…

I wonder what the samples number does then. Now that I look, it doesn’t really seem to change the image quality.

Well chanign the smaple number, should change the classic Anti Aliasing.

However try adding the FXAA Postprocessor to the viewport. This might look better and is multiple times faster.

Ah post processing filter, didn’t get that. Thanks.