Jump to content

fumbling around with Anti-Aliasing


MC.STEEL

Recommended Posts

For an one that doesent know A-A is a script put in games that detects sharp edges on the ingame models and softens them so they are nicer to look at,thus better graphics.

But i was wondering is it posible to make A-A into an effect, like for instance i have a kitty in my game but it looks a little bland so i modify the AA so its edges are now fuzzy.

Or i have a game with an artstyle that is like a canvas painting (think Dishonored) and to add some A-A that gives a brush stroke outline to the models.

keep in mind that i have almost no experience in coding games exept poking in game files.:)

Link to comment
Share on other sites

AA isn't a script. It's a rendering technique. Typically, you render at higher resolution (hence the xN that usually goes with it,) and then down-sample the image to screen resolution. The primary purpose is to actually get rid of aliasing, as the name suggests, but it also helps with jagged edges. Most of the differences between various AA methods are in how the down-sampling is carried out.

That said, yeah, there are shaders (aka effects) which allow you to get individual objects rendered as if AA is on. They tend to be a bit more "expensive" than full screen AA, because they are accomplished in multiple passes, but sometimes the effect is worth it.

Link to comment
Share on other sites

AA isn't a script. It's a rendering technique. Typically, you render at higher resolution (hence the xN that usually goes with it,) and then down-sample the image to screen resolution. The primary purpose is to actually get rid of aliasing, as the name suggests, but it also helps with jagged edges. Most of the differences between various AA methods are in how the down-sampling is carried out.

That said, yeah, there are shaders (aka effects) which allow you to get individual objects rendered as if AA is on. They tend to be a bit more "expensive" than full screen AA, because they are accomplished in multiple passes, but sometimes the effect is worth it.

Aha,so it more a shader im searching for, thanks for clearing that out.

Link to comment
Share on other sites

Basicaly "Aliasing" is a term for the sorts of weird artifact behaviors you get from digitizing something analog, and anti-aliasing is any sort of technique designed to try to combat aliasing. Aliasing often happens in the time-dimension when taking discrete samples of a repeating analog thing and the sample rate isn't fast enough to give you enough "in between" positions to see the repetition properly. (i.e. if you use a film camera that captures video at 24 frames a second you can't get a proper animation of a wheel spinning at anything faster than half that (12 revs per second). It will start looking like it's standing still, or going backward. And that's assuming the wheel has some obvious visual feature you can use to see how far it's rotated (i.e. a line painted marking a radius from edge to center.) If the wheel has symmetry that repeats several times through its rotation (i.e. spokes every 30 degrees so you can't see the difference between it rotated at 0, 30, 60, 90, etc degrees and they all look the same) then the problem happens even at much slower wheel speeds. This sort of effect you see in old westerns, where the wagon wheels rotate backward in the film, is a kind of aliasing.)

In pixelized graphics, one type of aliasing that occurs is to have jagged stair-step diagonal lines when the analog thing being simulated was meant to be a straight line. This happens in font renderers as well as in 3d graphics renderers.

In that specific context, anti-aliasing refers to making the pixels along the edge of the line a shade partway between the color on one side and the color on the other side of the line rather than just making them fully one or the other color. The human vision processing system is used to dealing with less than perfect resolution from its retinas, and having to "cook" the data quite a bit before your conscious brain sees it. When it sees an area of one color next to an area of another color, and the sensors right on the edge between them are registering colors partway between those two colors, it will pick this up and interpret it thusly: "my retina isn't high-res enough to resolve exactly where this edge is, and so I'm getting a bit of a fuzzy result here. If the color I'm getting from this pixel on my retina is closer to the color of the area on the left than the color of the area on the right, then that's telling me that the real location of the edge is closer to the right side of this single data pixel than the left side of it." The purpose of computer graphics anti-aliasing is to trigger this behavior that the human brain is already hardwired to perform. The brain is already used to interpolating between the "pixels" of its retina. By feeding it information simliar to what it's own retina would feed it if it wasn't high-res enough to resolve the pixels of the screen, it makes your brain "see" the smooth edges just like it would when viewing an object that's naturally coming out "pixelated" on its own retinas (due to fog, or poor focus, or the object being too distant, etc).

And yes, your retinas really do have pixels and really do have to register images in a "digitized" way - unable to see the data points between 'pixels'. It's just that your natural "pixels" aren't arranged in a nice regular Cartesian grid like they are on a computer screen. It's more like a random shotgun scatter pattern.

Link to comment
Share on other sites

The actual definition of aliasing is when quantization makes two different signals indistinguishable.

In the case of computer graphics, a smooth line becomes jagged, and you can't tell anymore if the original was jagged or not. The term is mostly used for edges, but it applies to a lot of other visual effects notably Moiré.

Also, anti-aliasing doesn't really decrease aliasing, but it makes it less obvious to the naked eye.

Link to comment
Share on other sites

The actual definition of aliasing is when quantization makes two different signals indistinguishable.

For some reason, I thought it only applies to the spectrum. Making digitized spectrum indistinguishable. But if this is the actual definition, then yeah, jagged lines definitely qualify. Thank you for correction.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...