Virtualresolution VRAM size?

BlitzMax Forums/BlitzMax Programming/Virtualresolution VRAM size?

Arowx(Posted 2010) [#1]
Hi just wondering if I do a game and write it at a high resolution and use virtual resolution to scale the graphics down, will the images still nead loads of Graphics Video Ram?


xlsior(Posted 2010) [#2]
I'm pretty sure that it won't change the memory requirements -- the detail of the high resolution images in memory is still preserved, it just the final visual representation that's getting scaled down...


Arowx(Posted 2010) [#3]
So the images would use a larger amount of Video Memory than they would really need?

E.g. a 128x128 image at a half size virtual resolution would only really need space for a 64x64 vram image but use up 4 times as much.


xlsior(Posted 2010) [#4]
No, it needs space for a 128x128 image, which gets *projected* to a 64x64 actual resolution before display. But you can adjust the projection (virtual resolution) and draw it larger as well, the info is still there.


Gabriel(Posted 2010) [#5]
Well yes, technically this is true, but the only other alternative is to include multiple versions of each image, and that's not very practical because it bloats your download size. I'm pretty sure that BlitzMax intelligently uses mipmaps if you enable them and so you'll only actually be drawing the 64x64 mip instead of the 128x128 one, so you won't get any performance decrease. Yes, you'll need the 128x128 one in memory, but unless you're making a game which uses more than 64mb of textures, this isn't really going to be an issue, is it?


Arowx(Posted 2010) [#6]
Sounds good, so ideally I would opt for a mid to upper range default resolution and then virtualise up or down to match the desktop resolution of the machine?

Can you virtualize and scale a viewport (sub-region of dispaly) or overlay, e.g. it could allow for a map, magnifying glass or hud effect to be used in game?


Arowx(Posted 2010) [#7]
Cool just playing with virutalresolution() didn't realise you can change it on the fly, so you can draw things at different virtual resolutions!

Personally I'm going to use virtualresolution for the game screens and the hud overlay, but keep the the game grid at a pixel resolution!

This is great!

Could even use this for a magnifying or high level map effect!


MGE(Posted 2010) [#8]
hmm.. not sure I would change that once it's set. Sounds interesting though, would love to see a demo if you get that up and running.


Arowx(Posted 2010) [#9]
I think SetVirtualResolution is just scaling the graphics and their coordinates and it seems to work at least in a simple example multiple times within the same drawing/update cycle!



You should see three seperate squares all drawn at different virtual resolutions and some text!