pouët.net

Go to bottom

aspect ratios / displays / resolutions etc.

category: general [glöplog]
the vpos register, used on ps3.0 to give you the current pixel on screen.
for example "float2 ScreenPosition : VPOS;"
in opengl its called something else, WPOS maybe?
added on the 2008-08-15 16:46:16 by smash smash
kb_: sorry for the confusion, i hadn't read your message before i posted that. i agree there's probably no 100% solution for this issue, unfortunately :/
added on the 2008-08-15 16:47:17 by havoc havoc
smash: ok thnx.
added on the 2008-08-15 16:48:32 by superplek superplek
neils: hey, at least i didnt say "rtfm." :)
added on the 2008-08-15 16:50:34 by smash smash
i'm just beeee-hind on my hands-on rendering-of-today stuff. thanks to shitty consoles like gcn and wii.
added on the 2008-08-15 16:57:18 by superplek superplek
Quote:
i'm just beeee-hind on my hands-on rendering-of-today stuff. thanks to shitty consoles like gcn and wii.


Hehe, well I've almost finished a game now with a ps3.0 renderer and often I can't help but think 'oh man, I could probably do this in tev stages'. Except of course that writing HLSL (actually CG in my case) code takes MUCH less time, and it's easier :)
added on the 2008-08-15 18:17:59 by ravity ravity
ravity, actually when I did the Wii version of our engine, I inadvertently ended up with what is an almost complete shader compiler backend (that outputs those things you've mentioned, among other... things ;). It'd be fun to write an HLSL parser frontend for that to translate 1.1 pixel shaders directly, but luckily I haven't had the time yet ;)
added on the 2008-08-15 18:22:17 by kb_ kb_
and speaking of consoles and aspect ratios: The notion of non-square pixel modes seems very unknown to many programmers... "huh? how can a 640x480 screen be 16:9?" *sigh*
added on the 2008-08-15 18:24:46 by kb_ kb_
On the issue of not being able to know the /real/ aspect of the screen, all modern monitors do expose the dimensions via DDC or whatever. Most operating systems use this to set the DPI value, but I guess Windows still just randomly picks 96DPI ;)

Example:
$ xdpyinfo | grep dimensions
dimensions: 1152x864 pixels (363x272 millimeters)
(DisplayHeight/WidthMM() in Xlib)

There must be a way to query this info in Windows...?

So in your auto-config magic, as long as you pick a resolution that has the same aspect as we know the monitor has (to avoid it stretching or squashing), you *should* be able to get it right in all circumstances...
added on the 2008-08-15 19:02:11 by nagato^ nagato^
nagato: Wrong. Read again what I've written. You still don't know if the GPU or display are scaling the image and how. You can change the scaling modes at least with NVIDIA cards, and I also know of many monitors able to change the scaling settings - and those aren't transmitted to the PC via DDC/EDID. You're completely ouf of luck.
added on the 2008-08-15 19:09:55 by kb_ kb_
the only solution i can see is to somehow check registry entries whether the driver will keep or discard the aspect ratio :/
added on the 2008-08-15 19:11:45 by Gargaj Gargaj
I said, "as long as you pick a resolution that has the same aspect as we know the monitor has".
Only a reeeeally braindead monitor would squish an image that had the /same/ aspect as the panel.
Or, I guess one that has been instructed to do so by the user ('cinema mode' on some TVs...), but then they deserve all they get ;)

Of course, I've never tried to implement aspect scaling based on this in an app people actually *use*. Perhaps there are monitors that lie about their physical dimensions. I was just throwing it out there since no one had mentioned that particular data yet.
added on the 2008-08-15 19:15:29 by nagato^ nagato^
Gargaj that's a hell another story. As far as I know it's not specified which specific keys in the registry should be set to what values with which format. In fact these values might change from driver to driver and I'm almost certain that OEMs that provide drivers for their lovely laptops will just ignore the spec and push a lot differently formatted values if they even do it that is. On the other hand, some users might not have access to the registry, even for reading which is yet another story. So I guess gambling for the aspect ratio is saner.
added on the 2008-08-15 19:21:19 by decipher decipher
tevstages are no laughing matter rav :)
they're some kind of sadomasochism

i liked it. for a bit.
added on the 2008-08-15 23:05:52 by superplek superplek

login

Go to top