Hot answers tagged

79 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 ...
Detheroc's user avatar
  • 1,436
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 ...
Detheroc's user avatar
  • 1,436
33 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 ...
Simon F's user avatar
  • 4,171
31 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 ...
glampert's user avatar
  • 1,459
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 ...
Nathan Reed's user avatar
  • 24.8k
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 ...
Nathan Reed's user avatar
  • 24.8k
14 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 ...
RichieSams's user avatar
  • 3,732
12 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 ...
Nathan Reed's user avatar
  • 24.8k
12 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 ...
Nicol Bolas's user avatar
  • 9,697
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 ...
JarkkoL's user avatar
  • 3,616
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 ...
aces's user avatar
  • 1,353
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 '...
Larry Gritz's user avatar
8 votes

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

Yes, it's possible in some extreme cases for HDR lighting and tonemapping to expose banding issues in color textures. In those cases, having a higher bit depth for the textures could be useful. ...
Nathan Reed's user avatar
  • 24.8k
8 votes
Accepted

Sine-based Tiled Procedural Bump

As you are taking the mean of a number of sine waves, your colour values will range from -1 to 1. From your example image, it looks like only the top half of this range of values (from 0 to 1) is ...
trichoplax is on Codidact now's user avatar
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 ...
joojaa's user avatar
  • 8,397
8 votes

How to do texturing with OpenGL direct state access?

I have now replaced it with the following, which works: ...
LinAGKar's user avatar
  • 183
8 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 ...
Nathan Reed's user avatar
  • 24.8k
8 votes

The mathematics of two dimensional interpolation on a quad

(It actually is easier to think (and compute) about this with triangles, but for the sake of the answer, let's first stick to your quad example.) For this you just have to define the point you're ...
Christian Rau's user avatar
7 votes

Sharp Corners with Signed Distance Fields Fonts

Quite interesting! I'm the author of the valve signed distance paper. Sorry that it's a little sparse on implementation details. I only included the two channel example as future work - I didn't have ...
chris green's user avatar
7 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 ...
Nathan Reed's user avatar
  • 24.8k
7 votes
Accepted

Texture rendering in OpenGL

This type of artifact is a tell-tale sign that you've messed up your texture image format at the byte level. It's hard to tell what exactly is wrong, but it's something along the lines of bad pitch or ...
IneQuation's user avatar
7 votes
Accepted

Why does substracting -1 in shader fail for a float data type?

Without seeing the error message I can't be sure but I think it's failing on the 1 being int instead of a float. float inv_coord = v_coord - 1.0; There is a ...
ratchet freak's user avatar
7 votes
Accepted

What's the difference between Sample and tex2D

They represent the same operation, but Sample is what it's called in D3D10 and newer versions of HLSL, while tex2D is what it's ...
Nathan Reed's user avatar
  • 24.8k
7 votes

Gaussian blur with transparency

I apologise for only skimming through your question/answer and the links you gave but I thought it would be a good idea to post what needs to be done to correctly do any blending and/or filtering on ...
Simon F's user avatar
  • 4,171
7 votes

Are textures automatically Morton-coded when loaded to VRAM?

In vulkan, like a lot of other implicit operations, this transition is made explicit. Images can be in one of 2 tiling layouts: optimal and linear. Linear images have a fixed layout while optimal is ...
ratchet freak's user avatar
6 votes

How to create a patterned object with variable pattern density in real-time?

In order to ensure that the pattern shapes are always either wholly present or absent, never cut off, it's necessary to ensure that the same p value is used for all ...
Nathan Reed's user avatar
  • 24.8k
6 votes

Perturbed image texture implementation from renderman language

As you've surmised, the transform() function transforms points from one co-ordinate space to another. (There are also ...
Dan Hulme's user avatar
  • 6,700
6 votes

What is missing in this image that stops it from looking like a photograph?

The hair seems to have sampling noise or aliasing in it. This might be poor jpeg compression but it does not look like it. I've never seen hair part that way (could just be me). The neck looks a ...
Olivier's user avatar
  • 1,585
6 votes

Making low discrepancy sequence noise textures, not LDS sample positions

In theory, it is possible to stuff every sample distribution into a texture to "pre-bake" it for fast access. The question is whether any of the results might be useful. For blue noise, this makes a ...
DrivenByNostalgia's user avatar
6 votes

How to access several textures from huge amount of textures in a shader?

Well, it's unlikely that 10,000 cubemaps could fit into memory at all (at 128x128x4-bytes-per-pixel, 10,000 cubemaps would require upwards of 4GB of RAM). But as far as the mechanism to use a large ...
Nicol Bolas's user avatar
  • 9,697

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