Jump to content

RenderStats Number Shadows.


Go to solution Solved by Josh,

Recommended Posts

Posted

to enable stats you have to call: 

world->RecordStats(true);

otherwise no value in the renderstats will be filled.

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Posted
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
image.thumb.png.524951249d10d9b34101f36ecb285f53.png

-- 📊 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

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

  • Solution
Posted

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...

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...