<p>Assume I have a texture with a repeating line pattern. The lines are exactly 2 texels wide (really thin). Ans very spaced out (50 texels in between each line).</p>

<p>I am now struggling with the minification issue. The goal is to have as many of these lines to show up when rendering them in a textured map plane.</p>

<p>Using OpenGL's standard mipmaping is not good enough, most of the lines are blurred out of existence, especially when the lines have certain orientations with the screen. </p>

<p>Assuming the lines are white and the background is black.
A slightly better technique is to, in addidition to mipmapping and anisotropic filtering, multisample a disk around the uv coordinate and look for white texels. If the result is white we discard the previous sample in favour of the white texels we just got.</p>

<p>The above gives slightly better results, but it's not perfect.</p>

<p>I have tried looking for papers and resources, but all I get on how to deal with this issue is "minification and anisotropic filtering" which I am already doing.</p>

<p>How to preserved thin/small details in a texture?</p>

<p>(I can't show the images displaying the problem)</p>

CC BY-SA 4.0
2019-03-20T23:48:49.620Z
You can't cheat the sampling theorem unfortunately.
lightxbulb
CC BY-SA 4.0
2019-03-20T23:57:34.833Z
If you can integrate it analytically on the other hand, then your issue is solved at the price of perf.
lightxbulb
CC BY-SA 4.0
2019-03-21T09:16:05.037Z
Your statement *"A slightly better technique is to, in addidition to mipmapping and anisotropic filtering, multisample a disk around the uv coordinate and look for white texels. If the result is white we discard the previous sample in favour of the white texels we just got."*  is curious. Are you taking gamma into account?  You can't correctly average black & white in sRGB space as "128" is *not* "half as bright".  That, *IIRC*, is actually around 186 in sRGB.  You thus really need to do your filtering in linear colour space.
Simon F
<texture><algorithm><sampling><antialiasing><fragment-shader>
Anti aliasing thin features in textures
Makogan
# Anti aliasing thin features in textures

(Asked by: username_0 on 2019-03-20)

Assume I have a texture with a repeating line pattern. The lines are exactly 2 texels wide (really thin). Ans very spaced out (50 texels in between each line).

I am now struggling with the minification issue. The goal is to have as many of these lines to show up when rendering them in a textured map plane.

Using OpenGL's standard mipmaping is not good enough, most of the lines are blurred out of existence, especially when the lines have certain orientations with the screen.

Assuming the lines are white and the background is black.
A slightly better technique is to, in addidition to mipmapping and anisotropic filtering, multisample a disk around the uv coordinate and look for white texels. If the result is white we discard the previous sample in favour of the white texels we just got.

The above gives slightly better results, but it's not perfect.

I have tried looking for papers and resources, but all I get on how to deal with this issue is "minification and anisotropic filtering" which I am already doing.

How to preserved thin/small details in a texture?

(I can't show the images displaying the problem)

**Tags:** texture, algorithm, sampling, antialiasing, fragment-shader

> **Comments:**
> **username_1**: You can't cheat the sampling theorem unfortunately.  
> **username_1**: If you can integrate it analytically on the other hand, then your issue is solved at the price of perf.  
> **username_2**: Your statement *"A slightly better technique is to, in addidition to mipmapping and anisotropic filtering, multisample a disk around the uv coordinate and look for white texels. If the result is white we discard the previous sample in favour of the white texels we just got."*  is curious. Are you taking gamma into account?  You can't correctly average black & white in sRGB space as "128" is *not* "half as bright".  That, *IIRC*, is actually around 186 in sRGB.  You thus really need to do your filtering in linear colour space.  

---

## 0 answers

