Hello, I’m having trouble adjusting the resolution for widescreen mode on Linux.
An example of the situation :
from direct.showbase.ShowBase import ShowBase
from panda3d.core import WindowProperties
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
wp = WindowProperties()
wp.set_undecorated(True)
wp.set_size(800, 600)
wp.set_fullscreen(True)
base.win.request_properties(wp)
self.accept("escape", self.userExit)
app = MyApp()
app.run()
When I run the script on Linux with Wayland, the window’s contents are stretched instead of being displayed with enlarged pixels or black borders on the sides.
I’m trying to achieve this kind of effect to make my game run better on low-end PCs, like the one I’m developing on.
It would depend, I think, on just what’s limiting your frame-rate.
If you’re being hit by a lot of overdraw, then yes, it may well help. If the issue is in your game-logic, or your vertex-shaders, then I daresay that it likely won’t. And so on.
Honestly, it might be worth first profiling your application to determine where the actual bottlenecks are, before considering means to fix them.
There’s also the question of just what sort of older hardware you’re targeting. For example, if it lacks some shader-extension that you’re relying on, then performance enhancements aren’t likely to help much–it would be more important to see if you can find a way to do without that shader-extension, I daresay.
Ideally, the thing to do, I daresay, would be to get the hardware that you’re targeting and test on it to see what issues it may present. Of course, that may not be feasible.
Of course, the point here is that the number of pixels for the fragment shader will be reduced. You need a smaller buffer and a fixed viewing angle of the camera lens. The problem is that now ShowBase automatically adjusts the lens size depending on the aspect ratio of the screen.
Another point is that the smaller the viewing angle of the camera lens, the fewer objects fall into the field of vision, which means that they are not rendered.
I’d suggest that, instead of trying to keep the lens unchanged, one change the buffer-dimensions to match the aspect ratio of the lens whenever that aspect ratio is changed.
The old games didn’t do such tricks, you just need a supported list of monitor resolutions. The player will usually choose a comfortable screen size (buffer) himself.