Recent

Author Topic: Castle Game Engine GPU Usage  (Read 1766 times)

lainz

  • Hero Member
  • *****
  • Posts: 3223
    • Lainz
Castle Game Engine GPU Usage
« on: December 20, 2018, 12:27:45 am »
Hi, I placed a castle game engine control in LCL and it was using 90% of the GPU, is that normal, anyone can confirm?

Edit: Switched to 64 bit Lazarus and only an empty 2D window of castle uses around 40% of gpu. Maybe it's normal.
« Last Edit: December 20, 2018, 01:40:00 am by lainz »

440bx

  • Hero Member
  • *****
  • Posts: 1126
Re: Castle Game Engine GPU Usage
« Reply #1 on: December 20, 2018, 02:24:58 am »
Hi, I placed a castle game engine control in LCL and it was using 90% of the GPU, is that normal, anyone can confirm?

Edit: Switched to 64 bit Lazarus and only an empty 2D window of castle uses around 40% of gpu. Maybe it's normal.
Given the fact that I know next to nothing about the LCL and components in general, I'm a bit reluctant to answer your question but, something (control, window, whatever it may be called) which isn't doing anything should not be taking 90% or 40% of anything either (GPU or CPU regardless.)   There is something wrong but, I don't have the necessary LCL/components knowledge to state what it may be.

Strictly from a system viewpoint, something empty that doesn't do anything should definitely not be consuming 40% of anything in the system.

I know that is not very helpful but... it's all I can state with confidence.
 
using FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

michalis

  • Full Member
  • ***
  • Posts: 100
    • Homepage
Re: Castle Game Engine GPU Usage
« Reply #2 on: December 20, 2018, 07:02:29 am »
Information about how to measure the speed of your game are on https://castle-engine.io/manual_optimization.php , see the section "Watch Frames Per Second".

If you actually don't do anything (or just don't do something every frame), you can set
Code: [Select]
Window.AutoRedisplay := false to experience less usage of all resources.

By default, we have
Code: [Select]
Window.AutoRedisplay = true, because it's easier (otherwise, when you do some low-level changes, you need to call Window.Invalidate explicitly). And in 99% of real use-cases you have something constantly animated on the screen (maybe UI, maybe 3D etc.).

Bottom line is: CGE is optimized to display something non-trivial, maybe animated. Load something non-trivial in your scene, and check that FPS stay high :)

The FPS (as measured by CGE) is the number you want to watch (if you're concerned about speed of you game). And CPU usage is the number you want to watch if you're concerned about your battery life :)
« Last Edit: December 20, 2018, 07:04:37 am by michalis »