14

This is perfectly possible Although the difference may not especially noticeable, I would expect sampling taking into account the exact pixel geometry to give a slightly more accurate image. You just need to offset your pixel centres per colour component according to the (average) location of the subpixel(s) of that colour. Note that not all pixel layouts ...


12

Raxvan is completely right that "traditional" anti aliasing techniques will work in raytracing, including those that use information such as depth to do antialiasing. You could even do temporal anti aliasing in ray tracing for instance. Julien expanded on Raxvan's 2nd item which was an explanation of super sampling, and showed how you'd actually do that, ...


11

As as far as I can tell Illustrator has 2 or 3 different rasterizer. The onscreen preview is also prone to the same gap artifacting as your show though its tuned to minimize the effect. Your post seems to imply that your interested in the "art optimized" output. Image 1: The different render modes of illustrator. Art optimized on left and hinted on right. ...


10

I think it's safe to say that there are two different ways of doing AA in raytracing: 1: if you have the final image and the depth image it is possible to apply almost all existing techniques that are used in games (FXAA, etc) Those work directly on the final image and are not related to raytracing 2: the second method is to take into account multiple rays ...


10

This is called subpixel rendering. The different primary colors in your monitor are not stacked on top of each other. Instead they are arranged near each other. Different monitors have different patterns but most commonly they are aligned so that the colors are side by side. If you know the physical arrangement, then you can prepare the image so that you ...


9

Is there a similarly fast way to draw antialiased lines? No, because by definition an anti-aliased line touches more pixels. Such algorithms will be slower. In a software rasterizer, the ubiquitous way to draw anti-aliased lines is Xiaolin Wu's line algorithm. It's not hard to implement, and anyway there's unusually high-quality pseudocode at that link. ...


9

Sure, you can use subpixel rendering for arbitrary images. However, subpixel rendering is really a generic 2D image processing technique — it has nothing to do with ray tracing specifically. You could just as well use it with any other 3D rendering method, or even with a simple 2D drawing, photograph or even video. Thus, I'd say that "subpixel ...


9

There is a great paper from 2006 on this topic, Filter Importance Sampling. They propose your method 2, study the properties, and come out generally in favor of it. They claim that this method gives smoother rendering results because it weights all samples that contribute to a pixel equally, thereby reducing variance in the final pixel values. This makes ...


9

There is really no good way of doing this efficiently analytically for all corner cases. Most or all commercial 2D renderers that attempt to do analytic coverage calculation make predictable errors that multisampling methods do not. A typical problem is two overlapping shapes that share the same edge. The common situation is that alpha channels sum up to a ...


9

From a signal processing point of view, you're sampling a continuous-domain signal, and you need to filter it to get rid of frequencies beyond the Nyquist limit. It's that filtering that leads to integrating over the pixel area—or more generally, integrating over the support of your antialiasing kernel (which need not be a box). Consider your rendering ...


8

Flickering can be a form of temporal aliasing. It's a similar phenomenon to spatial aliasing such as jaggies, but it occurs in time instead of space. For instance, a common cause of image flickering in graphics is when the camera or geometry is in motion, and geometric features fluctuate in pixel size as they move. For example, imagine a railing with thin ...


7

Let's suppose a fairly typical raytracing main loop: struct Ray { vec3 origin; vec3 direction; }; RGBColor* image = CreateImageBuffer(width, height); for (int j=0; j < height; ++i) { for (int i=0; i < width; ++i) { float x = 2.0 * (float)i / (float)max(width, height) - 1.0; float y = 2.0 * (float)j / (float)max(width, ...


7

Like in any other kind of signal processing, the relationship is Nyquist's theorem. An image is a discrete sequence of samples of a continuous signal. If the original signal has frequency components higher than half the sampling rate, then there will be aliasing. To put that another way, if you look at the real-world size of a pixel, any details smaller than ...


5

PIL's Image.convert function performs dithering by default when you convert the image to 1-bit—not simply thresholding. That's what creates the noise along the edges of the shapes; the antialiasing isn't the problem. Unfortunately, at such a low resolution, the dithering does more harm than good. I grabbed your original image from your other question and ...


5

Sean Barrett, the author of the stb libraries, wrote an article on how stb_truetype's rasterization works. It's quite readable. The article describes two methods of antialiasing, both based on scanline rasterization. In scanline rasterization, you iterate through the lines (rows) of pixels and keep track of which edges from the glyph outline are ...


4

And just to add: it is called "conflation" artifact and this is what AntiGrain Geometry used the compound shapes rasterizer for, see: flash_rasterizer.png http://agg.sourceforge.net/antigrain.com/demo/flash_rasterizer.png Also, this is what NV Path Rendering claims to improve on: An Introduction to NV_path_rendering (p. 67) or NV_path_rendering FAQ (#29).


4

You are in fact doing both things. You are integrating the area and because your result is still discrete samples you are reconstructing the signal to make it continious function. Therefore the higher order filtering. (Also human eye is a discrete sampler so it also reconstructs the signal) It took me a considerable amount of time to come into terms with ...


4

Instead of having a binary on/off per pixel you can instead make a heat map. The more points fall within the pixel the brighter the pixel is. Essentially create a 2D histogram which you then renormalize to get the grayscale for the output. If you want to blur the points then you can move a portion of the brightness to the next pixel based on the remaining ...


4

Short answer: Move your near clip plane further away. Depth buffer precision is very sensitive to the near clip plane distance. Complicated answer: Use different math in your view projection. There are a few techniques that can help, some of them are outlined here: https://developer.nvidia.com/content/depth-precision-visualized


3

Mitchell–Netravali has negative lobes, which are generally not recommended for small sample counts from what I understand; you tend to end up with both the positive and negative areas undersampled. Also, negative lobes do produce a sharpening or ringing effect that looks like what you're seeing. I'd try a nonnegative filter, such as a cut-off Gaussian or a ...


3

This is just a supplementary answer based on the accepted answer, using the original 64x128 pixel images instead of the zoomed-in interpolated screen shot. imtype = "RGB": (true RGB) imtype = "L": (grayscale 8-bit) imtype = "1": (binary 1-bit, threshold = 128) imtype = "1": (binary 1-bit, threshold = 80) Here are screenshots zoomed-in for ...


3

When drawing objects that exist in 3D space to a 2D plane (like your monitor or an image), there are a number of spaces that are useful to work in: Global Coordinates - Somewhere in your 3D world there is an origin, and objects will be placed relative to that origin. The camera will also be placed somewhere relative to that origin and will point in some ...


3

Have a look at Improved Alpha-Tested Magnification for Vector Textures and Special Effects [Gre07] (pdf). The gist of their method is to store distance field information in the font texture instead of bitmap glyphs. This information is then used to build much higher quality up-scaled versions of the glyphs. They even describe a rendering path without ...


3

Well you can render at higher resolution and sample down thhis is called FSAA and should just work without much change to render code. FSAA has the benefit of not having a conflation problem whereas smoothing does. No, something has to emit this info. You take the derivate (the gfx card does this for you) of the surface varying to determine how far the step ...


3

I'm not sure what happens there. Looking at the rendering of "considerations" in your example, the "cons" looks like what you get when you do crude sub pixel anti-aliasing, without applying the necessary "fix up" to make it look good. But then the "der" in the same word looks like there's no sub-pixel anti-aliasing. You can find a good article about how ...


3

This looks like JPEG artefacts so I guess the image went through a JPEG compression step at one stage and that permanently introduced noise into the image. The red channel is blurred stronger because JPEG additionally applies chroma subsampling. I suspect the original image was subpixel rendered as you shouldn't really have anything in the chroma channels ...


2

What methods are used for sub-pixel anti-aliasing that give such good results? You simply rasterize the letters as if they were 3x as wide. The results differ in the way you rasterize the curves, most notably what kind of anti-aliasing/sampling scheme does it use and whether it makes use of font hinting. For great overview see Texts Rasterization Exposures ...


2

In the olden days, for things like fonts, they didn't do antialiasing. They generally hand made bitmap fonts because it generated the clearest, easiest-to-read results. That said, you could look into error diffusion, halftoning or other dithering techniques for changing continuous-tone images into 1-bit images. These are techniques for reducing the bit ...


1

I want to know if there is a better way to check for self intersection, other than checking the original position? Since cubes are convex solids, a self-intersection check shouldn't introduce artefacts in your case, while it would in a more general ray-tracer (see my answer about the shadow terminator problem for more about that). In general, it's a good ...


1

If you're using Python, you can use a library such as matplotlib for this. It can take a numpy array and plot it as a standard chart using the function plot or as an image using imshow. The resulting image/plot can be displayed in an interactive window, or saved to a file, or it shows inline in your Jupyter notebook if you're using that. There are other (...


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