Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Gosu and video settings
- - By Infotaku Date 2016-03-16 12:36
Hi everyone !

I recently started using Gosu in order to (try to) give life to a long desired game of mine.
So far I just love it, being able to do games in my favorite language is a delight.

I have some questions regarding performance of image upscaling compared to loading a bigger image.
I'll explain :

1 ) I load an image of dimensions 128x128 and draw it without any scaling
2 ) I load an image of dimensions 64x64 and draw it with a scaling of 2

Is there any performance gain or cost doing 2 instead of 1 ?
In most games reducing the 'texture quality' setting increases performance, but I don't know if Gosu handles its assets the same way.
Ultimately what I'd like to have is some sort of 'video settings' page where the user will be able to adjust the game's look in order to achieve playable performances, by setting his screen resolution, field/depth of view, and tiles quality.

Does that seem possible ?
Parent - By bestguigui Date 2016-03-16 17:47
Hi !

JLNR will answer a lot better than me but :

- I guess that because Gosu uses OpenGL for display, the smaller the texture is, the better it should be because drawing twice bigger shouldn't be an issue in OpenGL and Gosu will have a smaller texture to load.

- for a menu that configurates the display, the only issue I can think of is that width and height are read-only variables that could not be changed after the Gosu::Window is initialized. So you'll have to create a new instance of Gosu::Window when you change for example the resolution.

But again, I'll let the master of the lib talk :)
Parent - By jlnr (dev) Date 2016-03-16 23:14
Welcome, glad you're enjoying Gosu!

Both options should perform exactly the same in terms of speed, but 2) will use less video memory. Thanks to bestguigui for the explanation :)

The rule of thumb with Ruby/Gosu is that the bottleneck is usually Ruby itself, not the rendering in OpenGL/Gosu. If you add lots of code to handle scaling factors based on the user's display quality settings, you might end up making the game slower for everyone because of all the calculations that happen in Ruby. AI and collision detection, for example, are easily more expensive than rendering in a typical Ruby/Gosu game.
Up Topic Gosu / Gosu Exchange / Gosu and video settings

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill