Skip to content

Commit 0c98f7c

Browse files
committed
Use anisotropy by default for better rotation
1 parent 9caba5d commit 0c98f7c

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/data/settingdefault.dl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ high_dpi : false
1212
window_title : soluna
1313
background : 0x4080c0
1414
tmpbuffer_size : 0x20000
15+
text_sampler :
16+
max_anisotropy : 16

src/render.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,17 @@ lsampler(lua_State *L) {
530530
desc.mag_filter = read_enum(L, "mag_filter", filter);
531531
desc.mipmap_filter = read_enum(L, "mipmap_filter", filter);
532532

533+
if (lua_getfield(L, 1, "max_anisotropy") == LUA_TNUMBER) {
534+
int max_anisotropy = lua_tointeger(L, -1);
535+
if (max_anisotropy > 0) {
536+
desc.min_filter = SG_FILTER_LINEAR;
537+
desc.mag_filter = SG_FILTER_LINEAR;
538+
desc.mipmap_filter = SG_FILTER_LINEAR;
539+
desc.max_anisotropy = max_anisotropy;
540+
}
541+
}
542+
lua_pop(L, 1);
543+
533544
static struct enum_string wrap[] = {
534545
{ "repeat", SG_WRAP_REPEAT },
535546
{ "edge", SG_WRAP_CLAMP_TO_EDGE },

src/service/render.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ local function render_init(arg)
290290
color0 = setting.background,
291291
swapchain = true,
292292
},
293-
default_sampler = render.sampler { label = "texquad-sampler" },
293+
default_sampler = render.sampler { label = "texquad-sampler", max_anisotropy = 16 },
294294
textures = {},
295295
font_texture = font_texture,
296296
views = views,

0 commit comments

Comments
 (0)