# OpenGL Antialiasing without multisampling?

## Recommended Posts

Is this even possible?

Unless, i would be able to remove the aliasing by some other way.
I know OpenGL had some option to enable antialiasing with GL_POLYGON_SMOOTH back in the days,
i seems that nowadays most graphic-cards could only do Antialiasing with the multisample option.
And in my case the graphic card dont support multisample, so what other way could one do to remove
aliasing artifacts and also [u]without[/u] the use of shaders?

I've attached an image of some cubes joined together, they seem to give some aliasing, that is the edges of the
polygons aint placed evenly together when they render. Is there a way to fix this?

[edit: im looking into the depth bias]

##### Share on other sites
Without the use of any shaders this could get quite tricky
What kind of card are you using exactly if it doesn't support multisampling?

There are some very decent alternatives to MSAA which use edge detection algorithms (like MLAA), but I don't see a way to implement those without the use of shaders

##### Share on other sites
Without the use of any shaders this could get quite tricky
What kind of card are you using exactly if it doesn't support multisampling?

There are some very decent alternatives to MSAA which use edge detection algorithms (like MLAA), but I don't see a way to implement those without the use of shaders
[/quote]

Actually its a strange hybrid of Intel® GMA X4500hd, i think.
some gl-extensions i can find here: [url="http://www.gamedev.net/index.php?app=core&module=attach&section=attach&attach_id=4224"]cantiga[/url]
and its gpu integrated in laptop: mobile esprimo v6535

this card doesnt support very much use of shaders. only ehm 1.10 i know of that is 100% supported.
shader-versions over that is more or less not-supported.

(edit: i dont have much experience in coding shaders, so it would be a bit daunting task to do anyway).

##### Share on other sites
You can do supersampling by rendering to a target that is 2x or 4x in resolution and then using standard texture sampling as a means to smooth detail when downsampling.

##### Share on other sites
[quote name='arbitus' timestamp='1311089592' post='4837438']
You can do supersampling by rendering to a target that is 2x or 4x in resolution and then using standard texture sampling as a means to smooth detail when downsampling.
[/quote]

Seeing as he is using a rather weak integrated card this could get rather expensive even for low resolutions

##### Share on other sites
[quote name='arbitus' timestamp='1311089592' post='4837438']
You can do supersampling by rendering to a target that is 2x or 4x in resolution and then using standard texture sampling as a means to smooth detail when downsampling.
[/quote]

hmm, yea, good idea. ill try that out.

by the way what i've discovered, which i didnt mention before was that
it just doesnt seem right that there would be white jaggies on the parts that are dark on that image.
i could try out changing the depth bias for each cube though. maybe that would work.
so my next question is this: would it be possible to retrieve the z-buffer value from each fragment and make the change per fragment in the z-bias
to remove those artifacts?
actually, when i come to think about it, i have a hunch that antialiasing the cubes or the whole back/front-buffer with that image would probably not
reduce the white stripes entirely, but i might be wrong. it's one thing i would try to figure out in a while.

thanks for the replies.

##### Share on other sites
Seeing as he is using a rather weak integrated card this could get rather expensive even for low resolutions
[/quote]

Do you mean that the GetFrontBufferData (or BackBuffer for that matter) is too expensive for that, per frame?
I havent really tested it, but you might be right. it probably would not work. Since i want this in a reasonable framerate.

##### Share on other sites
[quote name='Rudibs' timestamp='1311090924' post='4837456']
Seeing as he is using a rather weak integrated card this could get rather expensive even for low resolutions
[/quote]

Do you mean that the GetFrontBufferData (or BackBuffer for that matter) is too expensive for that, per frame?
I havent really tested it, but you might be right. it probably would not work. Since i want this in a reasonable framerate.
[/quote]

It mostly depends on how populated your scene will be, try to find out how many ms it takes to render 1 frame right now to get an estimate of how much time it will take to render to higher resolutions
If your scene will be simple without too many independent entities (ie. without too many draw calls, polygons, 'complicated' shading, etc.) you should be fine

I'd just try the suggested method and see how it works out

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627701
• Total Posts
2978705
• ### Similar Content

• A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

-What I'm using:
C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.
-Questions
Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?

• Both functions are available since 3.0, and I'm currently using glMapBuffer(), which works fine.
But, I was wondering if anyone has experienced advantage in using glMapBufferRange(), which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
• By xhcao
Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.
• By cebugdev
hi guys,
are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic
let me know if you guys have recommendations.
• By dud3
How do we rotate the camera around x axis 360 degrees, without having the strange effect as in my video below?
Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.
Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.

References:
Code: https://pastebin.com/Hcshj3FQ
The video shows the difference between blender and my rotation:

• 21
• 14
• 12
• 10
• 12