🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Adaptive Resolution

Published November 23, 2020
Advertisement

Since debugging is easier with a single thread, the frame rate isn't always reaching 60 while working on it. I figured frame rate is more important than resolution. This is actually super easy because of how I implemented rendering. The buffer isn't even a 2D array, it's just one big memory block, so I can change resolution to whatever I want whenever I want. So if a frame renders too slowly to maintain the frame rate, the next frame is slightly smaller. If it's significantly faster than it needs to be, it increases resolution. This makes the frame rate extremely stable. The hardware is responsible for scaling the render to fit the screen, which is the only part of the pipeline done in hardware.

I also put the renderer on it's own window, so that I can view the 3D and the map at the same time.

0 likes 2 comments

Comments

gregouar

You should probably not judge on the last frame, but on the worst frame in the last (couple of ?) second or something like that, to get less jittering.

November 23, 2020 03:02 PM
Wallace121215@gmail.com

@gregouar Great point. I actually do that, but only going up. On the first frame that is too slow, it'll instantly reduce resolution, but it requires 3 consecutive frames that are too fast in order to increment it. Originally, had no controls like that, and like you expected, there was some noticeable jitter, but upon implementing this, it's fixed.

November 23, 2020 09:20 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement