klepto2 Posted April 10 Posted April 10 to enable stats you have to call: world->RecordStats(true); otherwise no value in the renderstats will be filled. Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI
Yue Posted April 10 Author Posted April 10 15 minutes ago, klepto2 said: to enable stats you have to call: world->RecordStats(true); otherwise no value in the renderstats will be filled. Not Run -- 📊 Activar recolección de estadísticas world:RecordStats(true) Print("✅ [Debug] Sistema de depuración listo.") --------------------------------------------------- -- 🔁 Actualización periódica de stats en pantalla --------------------------------------------------- function this:Update() local stats = self.world.renderstats local fps = tostring(math.floor(stats.framerate or 0)) if self.labels.fps then self.labels.fps:SetText("FPS: " .. fps) end -- 📈 Memoria de Lua y tiempo de CPU promedio local memLua = math.floor(collectgarbage("count")) .. " KB" self.frameCounter = self.frameCounter + 1 self.timeAccumulator = self.timeAccumulator + (stats.rendertime or 0) if self.frameCounter >= 30 then local avgCPU = self.timeAccumulator / self.frameCounter local cpuTime = string.format("%.2f ms", avgCPU) self.labels.mem:SetText("Lua: " .. memLua .. " | CPU: " .. cpuTime) self.timeAccumulator = 0 self.frameCounter = 0 end -- 🖥️ Resolución actual de ventana local fbsize = self.window:GetWindow():GetSize() local resText = tostring(fbsize.x) .. " x " .. tostring(fbsize.y) if self.labels.res then self.labels.res:SetText("Resolution: " .. resText) end -- 🔳 Estado de ventana local fs = self.window:IsFullscreen() and "Fullscreen" or "Windowed" if self.labels.fs then self.labels.fs:SetText("Window: " .. fs) end -- 🌑 Cantidad de sombras generadas (estadística de motor) local shadows = tostring(stats.shadows or 0) if self.labels.shadows then self.labels.shadows:SetText("Shadows: " .. shadows) end end Quote
Solution Josh Posted Monday at 05:08 PM Solution Posted Monday at 05:08 PM It also only shows the number of updated shadows. If nothing has moved, the value won't change. However, it appears this value is not being filled in anyway, so I am adding it now... 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.