File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ ImGuiFreeType::BuildFontAtlas(io.Fonts, flags);
17
17
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
18
18
```
19
19
20
+ **Gamma Correct Blending**
21
+ FreeType assumes blending in linear space rather than gamma space.
22
+ See FreeType note for [FT_Render_Glyph](https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Glyph).
23
+ For correct results you need to be using sRGB and convert to linear space in the pixel shader output.
24
+ The default imgui styles will be impacted by this change (alpha values will need tweaking).
25
+
20
26
**Test code Usage**
21
27
```cpp
22
28
#include "misc/freetype/imgui_freetype.h"
Original file line number Diff line number Diff line change 10
10
// - v0.54: (2018/01/22) fix for addition of ImFontAtlas::TexUvscale member
11
11
// - v0.55: (2018/02/04) moved to main imgui repository (away from http://www.github.com/ocornut/imgui_club)
12
12
13
+ // Gamma Correct Blending:
14
+ // FreeType assumes blending in linear space rather than gamma space.
15
+ // See https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Glyph
16
+ // For correct results you need to be using sRGB and convert to linear space in the pixel shader output.
17
+ // The default imgui styles will be impacted by this change (alpha values will need tweaking).
18
+
13
19
// TODO:
14
20
// - Output texture has excessive resolution (lots of vertical waste)
15
21
// - FreeType's memory allocator is not overridden.
You can’t perform that action at this time.
0 commit comments