Hot answers tagged

76 votes

Sharp Corners with Signed Distance Fields Fonts

EDIT: Please see my other answer with a concrete solution. I have actually solved this exact problem over a year ago for my master's thesis. In the Valve paper, they show that you can AND two ...
user avatar
  • 1,406
50 votes

Sharp Corners with Signed Distance Fields Fonts

Sorry about the long wait, but it has become obvious that although the article I have promised is basically complete, the publishing process will take some time. Therefore, I have instead prepared an ...
user avatar
  • 1,406
32 votes

How does hardware texture compression work?

"How (hardware) texture compression works" is a large topic. Hopefully I can provide some insights without duplicating the content of Nathan's answer. Requirements Texture compression typically ...
user avatar
  • 3,941
27 votes
Accepted

How does hardware texture compression work?

As Simon's comment alluded to, one major difference between hardware texture compression and other commonly used image compression is that the former does not use entropy coding. Entropy coding is the ...
user avatar
  • 23.6k
27 votes
Accepted

How can virtual texturing actually be efficient?

Overview The main reason for Virtual Texturing (VT), or Sparse Virtual Textures, as it is sometimes called, is as a memory optimization. The gist of the thing is to only move into video memory the ...
user avatar
  • 1,379
22 votes
Accepted

How are mipmap levels computed in Metal?

Mip selection is pretty well standardized across devices today—with the exception of some of the nitty-gritty details of anisotropic filtering, which is still up to the individual GPU manufacturers to ...
user avatar
  • 23.6k
19 votes
Accepted

How does Texture Cache work in Tile Based Rendering GPU

Whether it's a tile based GPU or not doesn't really affect the texture cache architecture. The memory layout of texture will look like some flavor of Morton order or Hilbert curve in all GPUs. As a ...
user avatar
17 votes
Accepted

How does Texture Cache work considering multiple shader units

At the top level, a GPU is subdivided into a number of shader cores. A small GPU in a notebook or tablet may have only a few cores while a high-end desktop GPU may have dozens. In addition to the ...
user avatar
  • 23.6k
17 votes
Accepted

Are lookup textures still used for anything?

Yes, lookup textures are still used. For example, pre-integrated BRDFs (for ambient lighting, say), or arbitrarily complicated curves baked down to a 1D texture, or a 3D lookup texture for color ...
user avatar
16 votes
Accepted

Is using many texture maps bad for caching?

Just adding to imallett's answer, it is true that increasing the number of accesses to different texture data in a shader will increase pressure on the GPU cache(s), but there are several other ...
user avatar
  • 3,941
15 votes
Accepted

Performance of vector graphics versus bitmap or raster graphics

As TheBuzzSaw said, it does depend on lots of things, including implementations of the rasterized graphics vs the vector graphics. Here are some high performance vector graphics methods that are ...
user avatar
  • 7,341
15 votes

How is anisotropic filtering typically implemented in modern GPUs?

The texture filtering hardware takes several samples of the various mipmap levels (the maximum amount of samples is indicated by the anisotropic filtering level, though the exact amount of samples ...
user avatar
  • 1,100
13 votes
Accepted

How does mip-mapping work with non-power-of-2 textures?

The rule is that to compute the next mipmap size, you divide by two and round down to the nearest integer (unless it rounds down to 0, in which case, it's 1 instead). For example, a 57x43 image would ...
user avatar
  • 23.6k
13 votes

Changing image so it would look like through colorful glasses

(XYZ) can be the RGB colour you want to tint your scene by. For the above scene it can be a red colour (1.0, 0.0, 0.0) or something similar with a strong red component. Bear in mind that since you ...
user avatar
13 votes

How can virtual texturing actually be efficient?

Virtual Texturing is the logical extreme of texture atlases. A texture atlas is a single giant texture that contains textures for individual meshes inside it: Texture atlases became popular due to ...
user avatar
  • 3,512
13 votes
Accepted

How to do texturing with OpenGL direct state access?

You still have to bind the desired texture to the texture unit to use it for rendering. In your current code, you're not specifying which texture to use for rendering, so the GL driver doesn't know ...
user avatar
  • 23.6k
12 votes
Accepted

Algorithms for down sampling an image?

When Sean and I wrote stb_image_resize we chose Mitchell for downsizing. Mitchell is similar to Cubic, you can read about the cubic class of sampling filters in Mitchell Netravali 1988. They are all ...
user avatar
12 votes
Accepted

Is it good practice to use all the available texture units?

Modern hardware doesn't really have the concept of texture binding points as exposed by OpenGL. Rather, the shader unit uses a descriptor (which is just some kind of fat pointer) which can potentially ...
user avatar
  • 1,100
11 votes
Accepted

Is modifying a texture (painting on it) considered a "state change"?

Updating an area of memory in the graphics device (a texture, buffer, and the like) is not quite the same as changing a rendering state. What makes a render state change expensive is the amount of ...
user avatar
  • 1,379
11 votes
Accepted

Help me grasp Anisotropic Filtering (AF)

To understand the nature of anisotropic filtering, you need to have a firm understanding of what texture mapping really means. The term "texture mapping" means to assign positions on an object to ...
user avatar
  • 8,101
10 votes
Accepted

Perspective Correct Texture Mapping

You are on the right track but what you need to do is to calculate u/w and v/w, and also 1/w for each vertex, which you interpolate linearly in screen space in your rasterizer. Then for every pixel ...
user avatar
  • 3,556
10 votes
Accepted

Seamless Textures

For these types of algorithms, you usually have to rely on multiple forms of texture synthesis. That doesn't mean you have to generate the whole texture from scratch. For example, you could regenerate ...
user avatar
  • 1,323
9 votes

How is anisotropic filtering typically implemented in modern GPUs?

The API requirements can be found in any of the specs or extensions. Here is one: https://www.opengl.org/registry/specs/EXT/texture_filter_anisotropic.txt All GPU vendors likely deviate from the spec ...
user avatar
  • 1,974
9 votes
Accepted

16bit half-float linear HDR images as (diffuse/albedo) textures?

In film production, we almost never use 8-bit textures for color/albedo, because of banding, etc. (JPEG is especially problematic since by spec, it's sRGB rather than linear values.) We either use '...
user avatar
9 votes
Accepted

Using RGB texture format for image load/store

RGB8 format and similar are often not supported by GPUs (or only supported for a subset of GPU operations) because they don't have a power-of-two number of bytes per pixel. RGB8 would be 24 bits or 3 ...
user avatar
  • 23.6k
8 votes
Accepted

Help me find out what this texture mapping technique is called

What you see in the image called a UV map. That is, it is simply texture coordinates to be looked up encoded in a image. Same thing happens in all texture lookup in 3D there is a underlying sampler ...
user avatar
  • 8,169
8 votes

Is using many texture maps bad for caching?

The answer depends on what you mean. Modern hardware (e.g. with bindless textures) really doesn't care too much how many textures are "bound". The real question is how many you use. Textures ...
user avatar
  • 1,790
8 votes

Performance of vector graphics versus bitmap or raster graphics

There might be. Less technical answer: If you're building a website or another application where you have nothing to do with the graphics programming then the answer is probably yes. The underlying ...
user avatar
  • 80
8 votes
Accepted

Is a cubic Lagrange interpolation tensor product the same as bicubic interpolation?

It turns out that no, while you can use bicubic Lagrange interpolation for bicubic texture sampling, it isn't the highest quality option, and probably not actually likely to be used. Cubic hermite ...
user avatar
  • 7,341
8 votes
Accepted

Map a texture onto a hyperbolic triangle

My guess is that to get the texture to look right, you'll have to subdivide the interior of the triangle as well, and approximate the non-linear UV mapping within it. Currently, it looks like you're ...
user avatar
  • 23.6k

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