47 lines
1.7 KiB
Zig
47 lines
1.7 KiB
Zig
dtAverage: f64 = 0.0,
|
|
allocator: std.mem.Allocator,
|
|
|
|
pub var NeonObjectTable: core.EngineObjectVTable = core.EngineObjectVTable.from(@This(), null);
|
|
|
|
pub fn create(allocator: std.mem.Allocator) !*@This() {
|
|
const self = try allocator.create(@This());
|
|
|
|
self.* = .{ .allocator = allocator };
|
|
|
|
return self;
|
|
}
|
|
|
|
pub fn tick(self: *@This(), dt: f64) void {
|
|
core.rollingAverage(&self.dtAverage, dt, 50);
|
|
|
|
if (ig.begin("renderer debug", null, .{})) {
|
|
_ = ig.sliderFloat("directional light yaw", &rend.context().directionalLightYaw, 0, 360, null, .{});
|
|
_ = ig.sliderFloat("skyboxLevel", &rend.context().skyboxSystem.brightnessFactor, 0, 10, null, .{});
|
|
_ = ig.sliderFloat("lightLevel", &rend.context().lightPower, 0, 100, null, .{});
|
|
_ = ig.sliderFloat("ortho near", &rend.context().shadowOrthoNear, 0, 200, null, .{});
|
|
_ = ig.sliderFloat("ortho far", &rend.context().shadowOrthoFar, 0, 6000, null, .{});
|
|
if (self.dtAverage > 0.000001) {
|
|
ig.textFmt("frameTime: {d:.2}ms ({d:.2}fps)", .{ self.dtAverage * 1000, @as(u32, @intFromFloat(1 / self.dtAverage)) }) catch unreachable;
|
|
}
|
|
|
|
ig.textFmt("SSAO settings: ", .{}) catch unreachable;
|
|
|
|
const ssao = rend.context().ssaoSystem;
|
|
_ = ig.sliderFloat("radius", &ssao.radius, 0.1, 1.0, null, .{});
|
|
_ = ig.sliderFloat("bias", &ssao.bias, 0.0025, 1.0, null, .{});
|
|
|
|
_ = ig.checkbox("enable SSAO", &ssao.enable);
|
|
}
|
|
ig.end();
|
|
}
|
|
|
|
pub fn destroy(self: *@This()) void {
|
|
self.allocator.destroy(self);
|
|
}
|
|
|
|
const backlog = @import("Backlog");
|
|
const core = backlog.core;
|
|
const rend = backlog.rend;
|
|
const ig = backlog.imgui.api;
|
|
const std = @import("std");
|