feat: deferred lighting (WIP)

This commit is contained in:
MihailRis
2025-06-14 22:43:18 +03:00
parent 2ad076bec3
commit e849d5e9b7
10 changed files with 105 additions and 12 deletions
+4 -2
View File
@@ -1,14 +1,14 @@
local function configure_SSAO()
local slot = gfx.posteffects.index("core:default")
gfx.posteffects.set_effect(slot, "ssao")
gfx.posteffects.set_intensity(slot, 1.0)
-- gfx.posteffects.set_intensity(slot, 1.0)
-- Generating random SSAO samples
local buffer = Bytearray(0)
for i = 0, 63 do
local x = math.random() * 2.0 - 1.0
local y = math.random() * 2.0 - 1.0
local z = math.random()
local z = math.random() * 2.0
local len = math.sqrt(x * x + y * y + z * z)
if len > 0 then
x = x / len
@@ -77,4 +77,6 @@ function on_hud_open()
player.set_vel(pid, 0, 1, 0)
end
end)
configure_SSAO()
end