Torque and Widescreens - What's the Best Approach?
by Kalle Wik · in Torque Game Builder · 05/07/2007 (6:43 pm) · 6 replies
When using a widescreen monitor, TGB's fullscreen mode doesn't display correctly - it stretches out the image to fit the screen, which looks pretty lousy. So, I set out to add correct widescreen functionality, but it's proving no simple task, so I'm looking for some advice on the best way to implement it.
This seems quite similar to the problem in this thread: http://www.garagegames.com/mg/forums/result.thread.php?qt=44452
But unfortunately, it seems to be unanswered there as well.
My solution so far:
The first thing I tried was simply modifying the Canvas code slightly to change the screen bounds. This works for the most part (as long as all GUI elements have relative sizing), but it has some problems:
1) GUI text is still stretched.
2) Elements which are placed by script become FUBAR.
Secondly, I tried changing the dglSetViewPort code, but this appears to only effect scene windows, not GUI elements. Actually, looking through the code, its not apparent where the GUI controls are getting their display position from - no dglViewport or similar calls are used in rendering them, or in DemoGame::processTimeEvent, where the Canvas's render function seems to be called from.
Resizing the actual window dimensions to the correct ratio (for instance, 960x600 instead of 800x600) seems to fix the text issue, but that still leaves the problem that script-placed elements have to be manually adjusted to display correctly.
If possible, I'd like to find a way to change the actual rendering area, for the GUI as well as the scenewindow, so that there'd be no difference in display modes from the PoV of the script. Has anyone done this before, or something similar?
This seems quite similar to the problem in this thread: http://www.garagegames.com/mg/forums/result.thread.php?qt=44452
But unfortunately, it seems to be unanswered there as well.
My solution so far:
The first thing I tried was simply modifying the Canvas code slightly to change the screen bounds. This works for the most part (as long as all GUI elements have relative sizing), but it has some problems:
1) GUI text is still stretched.
2) Elements which are placed by script become FUBAR.
Secondly, I tried changing the dglSetViewPort code, but this appears to only effect scene windows, not GUI elements. Actually, looking through the code, its not apparent where the GUI controls are getting their display position from - no dglViewport or similar calls are used in rendering them, or in DemoGame::processTimeEvent, where the Canvas's render function seems to be called from.
Resizing the actual window dimensions to the correct ratio (for instance, 960x600 instead of 800x600) seems to fix the text issue, but that still leaves the problem that script-placed elements have to be manually adjusted to display correctly.
If possible, I'd like to find a way to change the actual rendering area, for the GUI as well as the scenewindow, so that there'd be no difference in display modes from the PoV of the script. Has anyone done this before, or something similar?
#2
Setting the size of the scenewindow within the GUI worked fine for the actual scenewindow, but not for overlay or popup GUIs (unless I were to put adjustment code in each GUI script, which I'm hoping to avoid).
05/08/2007 (12:52 pm)
Sorry I didn't clarify, that's what I've been doing - the idea is to have the everything appear in a 4:3 portion of the screen, with black screen, or ideally a GUI, occupying the sidebars. Setting the size of the scenewindow within the GUI worked fine for the actual scenewindow, but not for overlay or popup GUIs (unless I were to put adjustment code in each GUI script, which I'm hoping to avoid).
#3
05/08/2007 (11:53 pm)
You could try to do the stuff relative to the center, this one should work. I say should because the 4:3 <-> 16:10 correction most likely needs to be added anyway unless you do it somewhere lowerlevel so that the general calculations are corrected which would be the cleaner way.
#4
05/09/2007 (5:29 am)
I'm interested to hear how you resolve this, as I'm taking the other approach - that is I'm writing my game in widescreen format with the torque design resolution set to 1280x720. It looks great either windowed or fullscreen on my 1680x1050 monitor, but on a 4:3 ratio monitor I'll want to display it with black bands on the top and bottom, and maybe move the HUD elements onto these black bands.
#5
05/21/2011 (6:58 pm)
Don't know if you guys are still around, but did anyone find an elegant solution to this? I'm trying to make my game in widescreen (16:9) and then have black letterbox view for 4:3 perspective. I've thought of a couple ways to do it, but none of them are pretty.
#6
www.garagegames.com/community/forums/viewthread/97019/1#comment-651307
05/23/2011 (9:42 am)
Here's what I've done in the past. If something doesn't make sense there, just let me know!www.garagegames.com/community/forums/viewthread/97019/1#comment-651307
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
What you actually could try to do (haven't tested yet, but will have to do at some point as my main screen is 1680x1050 as well and TGB actually does not render widescreen just stretch 4:3 which is inacceptable for the visual quality) is that you actually place the actual game window ontop of an already existant video.
This means that you actually have a main window and place a scene graph / new window on top of it which is aligned to the middle and has a 4:3 ratio with size set by script on loading the level, similar how GBA player on Game Cube does for example by drawing a "gaming window" on top of some full sized background ... thats the only usefull idea I came up with without giving the widescreen some serious benefit by rendering it with the correct setup to make TGB render wide screen ...