Yue Posted Thursday at 12:52 AM Posted Thursday at 12:52 AM One Shadow on Scene, RenderStats return 0 Shadows. Quote
klepto2 Posted Thursday at 02:12 PM Posted Thursday at 02:12 PM 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 Thursday at 02:29 PM Author Posted Thursday at 02:29 PM 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
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.