diff --git a/src/AssetManager.zig b/src/AssetManager.zig index 054a21f..91c0063 100644 --- a/src/AssetManager.zig +++ b/src/AssetManager.zig @@ -367,7 +367,7 @@ fn loadTextureErr(self: *AssetManager, id: AssetId) !*const LoadedTexture { ); for (0..mip_level_count) |mip_level| { - const desc = transcoder.getImageLevelDescriptor(0, 0) catch unreachable; + const desc = transcoder.getImageLevelDescriptor(0, @intCast(mip_level)) catch unreachable; const out_buf = try self.frame_arena.alloc( u8, @intCast(try transcoder.calcTranscodedSize(0, @intCast(mip_level), format)), diff --git a/tools/asset_compiler.zig b/tools/asset_compiler.zig index 3da3d23..1dc522a 100644 --- a/tools/asset_compiler.zig +++ b/tools/asset_compiler.zig @@ -181,6 +181,7 @@ fn processTexture(allocator: std.mem.Allocator, input: [*:0]const u8, output: [] var y: c_int = undefined; var comps: c_int = undefined; + c.stbi_set_flip_vertically_on_load(1); const FORCED_COMPONENTS = 3; // force rgb const data_c = @as(?[*]u8, @ptrCast(c.stbi_load(input, &x, &y, &comps, FORCED_COMPONENTS))) orelse return error.ImageLoadError; defer c.stbi_image_free(data_c); @@ -197,7 +198,7 @@ fn processTexture(allocator: std.mem.Allocator, input: [*:0]const u8, output: [] // TODO: configure per-texture somehow params.setQualityLevel(64); - params.setBasisFormat(basisu.BasisTextureFormat.etc1s); + params.setBasisFormat(basisu.BasisTextureFormat.uastc4x4); params.setColorSpace(basisu.ColorSpace.srgb); params.setGenerateMipMaps(true);