It works!
This commit is contained in:
@@ -170,6 +170,11 @@ fn loadTexture(engine: *Engine, filename: []const u8, usage: Texture.Usage, temp
|
||||
var img = try stbi.Image.loadFromMemory(file_buf, usage.samplesPerTexel());
|
||||
defer img.deinit();
|
||||
std.debug.assert(img.num_components == usage.samplesPerTexel());
|
||||
if (usage == .normal) {
|
||||
for (img.data) |*sample| {
|
||||
sample.* = sample.* +% 128;
|
||||
}
|
||||
}
|
||||
|
||||
var texture = try Texture.init(engine, .{
|
||||
.width = img.width,
|
||||
|
||||
Reference in New Issue
Block a user