Tag Info

Hot answers tagged

17

There are several alternatives to native MSAA in OpenGL. With post-processing effects, the best thing about them is that you can usually just throw in the shader to the final, unprocessed image and it does the rest. Here are three methods worth taking a look: Fast Approximate Anti-Aliasing (Geeks3D) - Good in most cases. Pretty easy to apply and ...


10

The second option - drawing at a higher resolution than the target and downsampling to the target resolution - is known as supersampling and is considered a form of AA; if you read about this topic you'll see it referred to as SSAA. It will almost certainly be slower than turning on other AA techniques built into modern games, such as MSAA (multisampled ...


6

Create a new SamplerState of your own and set it like this: mySampler.Filter = TextureFilter.Linear; mySampler.AddressU = TextureAddressMode.Clamp; mySampler.AddressV = TextureAddressMode.Wrap; mySampler.AddressW = TextureAddressMode.Wrap; The V coordinate will be wrapped (since you want horizontal repeat) and the U will be clamped.


6

You should set the sampler state to Point: graphicsDevice.SamplerStates[0] = SamplerState.PointClamp;


6

Taking your example, you have a step function of the distance, which produces a perfectly hard (aliased) edge. A simple way to antialias the circle would be to turn that into a soft threshold, like: float distFromEdge = 1.0 - dist; // positive when inside the circle float thresholdWidth = 0.01; // a constant you'd tune to get the right level of softness ...


6

With polygon-based graphics, the only option you have to better approximate a circle is to subdivide further. 720 triangles will result in a smoother circle, but 1440 will give you an even smoother circle, but 2880... A perfect circle, created using polygons, would require an infinite amount of infinitesimally small polygon sections (in other words, it just ...


5

There was a SIGGRAPH 2011 course on antialiasing in games, which will probably give you far more information about many more types of AA than you really want. :) When you run a typical PC game and in the options it gives you a choice of "2X, 4X, or 8X" antialiasing, it's referring to multisample antialiasing, MSAA. This stores super-resolution frame ...


5

Try this in Photoshop: Make a new document. Make a new layer. It will be transparent. Delete the background layer. Your document should be all transparent now. It will look like a checkerboard. Draw the hexagon onto that transparent layer. Save this as a 24-bit PNG with transparency. Now bring that into PyGame. You may need to do some convert_alpha() ...


5

There's lots of ways to do antialiasing. One is to use multisample antialiasing (MSAA), where your back buffer actually stores multiple sub-pixel samples, and when you render triangles, lines, etc. the system automatically fills in the correct set of samples in each pixel. Then at the end of rendering the image is "resolved" by averaging over all the ...


4

If you are dealing with more than one triangle in your world, the corners aren't even the only problem. If you're rendering an antialiased triangle over a known background, you can calculate the coverage at a pixel and blend using that alpha. But if you then render a second triangle over the first one, you have to ask a question: Did this second triangle ...


4

You are almost right about it, but XNA has some built-in features to help you with all of that! Render to Texture My first hunch is to render the scene into a texture Almost. You would start by rendering your scene into a RenderTarget2D (which actually inherits from Texture2D so it does qualify as rendering to a texture). Something like: ...


4

Um, why don't you just use multisampling like everyone else? Even if you're using deferred rendering, there are ways to use multisampling in tandem with that. Multisampling covers triangle edge aliasing, while anisotropic filtering covers texture aliasing. Between those two, you pretty much have all the antialiasing techniques you need. Unless you're ...


4

If you want to do vector graphics with OpenGL, you should do taht in shaders. E.g. gl_FragColor = ( length(gl_FragCoord.xy) < 0.5 ) ? vec4(1,1,1,1) : vec4(0,0,0,1); You can do some "supersampling" to make it smooth, or analytically compute the area of pixel, which is overlapped by circle. BTW. there is also OpenVG API out there.


3

Your TextureOptions settings are likely to be the cause, see the call that you use for creating your TextureAtlas. Try the different TextureOptions and see which one you like the most. For more information, see the related thread on the AndEngine forum.


3

That method was removed in XNA4 since it was no longer needed since we now have the reach and hi-def profiles. You can now just prefer multisampling or not and the framework will set an appropriate MultiSampleCount if possible. You can still set this value yourself here but setting it too high won't cause an error. ...


3

Without seeing any code it's hard to guess, but here are two three major pitfalls to look out for: On 3D graphics hardware, the edges of adjacent polygons are only guaranteed to align 100% if their vertices are 100% the same. So if you generate the vertices for each cube individually, and you use an algoritm that introduces tiny floating point errors... ...


3

The default texture magnification filter seems to be bilinear filtering, which will interpolate linearly between texels if the texture needs to be blown up to cover the target. If the sample doesn't lie on a texel center, bilinear filtering takes the closest pixels horizontally and vertically and blends them together based on their distance to the sample ...


3

2. They may not always be normalized after transformation into projection or world space, even if you provide the correct inverse transpose of the vertex transformation.


3

The modern technique is to render your scene to one or several framebuffer objects of the desired size, then use these framebuffer objects as textures and render them to the screen. Basic usage means setting the texture to GL_LINEAR and does not require a shader. Advanced usage means using a shader to enhance the antialiasing, for instance by doing edge ...


3

As you have noticed clipping or regions in GDI+ are not antialiased as they are both pixel based where a given pixel can either be completely included or excluded. To do what you want in GDI+ you can apply an alpha mask to the image yourself. Basically you fill a rectangle of the size of the area affected with black color and then draw the hole with white ...


3

Here's a solution, but you'll need to call createDeviceEx instead of the current function. You'll have to pass a SIrrlichtCreationParameters structure to the above function, with the AntiAlias member set to true (or another value ? It seems that the variable is an unsigned integer, and not a bool, never noticed that). Of course you'll have to define some ...


3

I don't know much about java.awt but from the documentation I can tell you this: The antialiasing option you are using does not use multiple samples like MSAA and thus does not support the MSAA x2, x4 ... sample counts. The antialiasing method of awt blends the edge pixels with the destination surface by using the exact coverage of the target pixel as the ...


3

It all comes down to memory bandwidth with proper anti-aliasing techniques (e.g. MSAA, SSAA, CSAA). While 8x SSAA and 8x MSAA have identical storage requirements (8x), the workload between the two algorithms is quite different. Multisample anti-aliasing adds some intelligence to the rasterization stage to reduce the number of fragments that have to be ...


3

Multisampling AA (MSAA) is only capable of multisampling the geometry edges. If you want your sprites to be anti aliased, you should use a post process AA, like FXAA for example. You can also use bilinear filtering to smooth out the texture itself (it seems that you are using point/nearest filtering). Having multiple mip-maps for your textures can also ...


2

N_a is the result of the normal map fetch, which is usually not unit length because it is a linear blend of almost-unit vectors. The normal map typically encodes normals in tangent space, which is to say that a normal in the map with the value [0,0,1] points directly away from the surface along the surface normal. You are right that N_a is "the normal ... ...


2

Multisampling runs the pixel shader once per pixel, while visibility (geometry coverage, depth/stencil tests, etc.) are done per sample. The same color output from the pixel shader is replicated to all the samples that pass the visibility tests. The fact that the pixel shader is only run once per pixel is what makes MSAA faster than supersampling. In ...


2

If I understand your question correctly, the calculation you're trying to do is very similar to the standard projection or primary-ray generation calculations. Here's a rough diagram that illustrates the solution.


2

Generally speaking, yes, postprocess antialiasing like FXAA is making MSAA much less popular. As you mentioned, the performance hit for MSAA is very high, mainly due to the increased memory bandwidth required for reading/writing render targets. It also, of course, consumes a lot more memory for those render targets - not as big a deal for PC gamers who ...


2

Have a read of this article on texture aliasing (and the ones it links). It explains exactly why you are having this issue. While there are many techniques for rendering an anti-aliased circle, the simplest one for your situation is to turn on mipmaps for your texture. To do so, make sure your texture is in an XNA Content Project. Select it and press F4. ...


2

A breakdown of capabilities by feature level is available here. You'll note there is no explicit mention of MSAA support. However, the documentation does point out that for the 9.3 feature level, no guarantee is made for MSAA support.



Only top voted, non community-wiki answers of a minimum length are eligible