Highres rendering patch

Developer's Forum, for discussion of bugs, code, and other developmental aspects of OpenGLide.

Highres rendering patch

Postby gulikoza » 2010-10-21 @ 16:52

Hi,

Some of you might remember some (long? :happy:) time ago, Moe and I started a project to see if we could port MacGLide (which is/was supposed to be a MAC port of OpenGlide) enhancements back to Linux & Windows (actually make it crossplatform using SDL). We never released the code since it barely built and the project somehow died soon after cause of lack of time. But there are some interesting ideas in the MacGLide fork including making OpenGL render at higher resolution than Glide thinks it's rendering. This is a patch to bring that functionality back to OpenGlide (a full circle :happy:)

It's fairly simple, just the matter of correctly setting glViewport, resizing LFB reads/writes and presto - any resolution you want. I can't take all the credits, the code is originally taken from Macglide, modified for our SDL-Glide project and now ported to OpenGlide. I've tested it with a few games, there doesn't seem to be much problems. The LFB writes are bilinearly resized to target resolution, reads are a bit simpler (a simple nearest resize). I've also fixed some memory management problems (seems like OpenGlide was allocating twice the necessary space for buffers??). There might be problems if a game reads the LFB, adds some stuff, then writes the whole thing back (could look ugly because of the resizing). If that happens, there might be a reason to add some code to check and write only the pixels that have really changed...I have also added/copied the code for grLfb*Region (which in turn seems to be taken from the linux sst1 driver source), since this was totally broken/missing in OpenGlide.

A new config option was added: Resolution. It's a floating point where 0 specifies original/auto resolution, 1.0-16.0 are scale factors and anything larger than that is fixed width (with height calculated automatically, 4:3 AR assumed). That's how we made it in SDL-Glide project I haven't changed it now. Any comments/suggestions/problem reports are welcome.
Attachments
openglide-highres.diff
OpenGlide current cvs patch
(31.12 KiB) Downloaded 3356 times
TR1600.jpg
Tomb Rider @1600x1200
(140.59 KiB) Downloaded 1055 times
User avatar
gulikoza
Oldbie
 
Posts: 1700
Joined: 2004-6-25 @ 14:53

Re: Highres rendering patch

Postby Miki Maus » 2010-10-23 @ 16:39

Tested it and it works great. Though I can't get openglide to render the games in fullscreen in WinXP, it is always using current desktop resolution with game screen in the upper left corner of the screen with black background around.
Also, are the patches from "Various patches for OpenGlide" already included in the current CVS?
User avatar
Miki Maus
Member
 
Posts: 197
Joined: 2004-10-18 @ 22:19
Location: Cave

Re: Highres rendering patch

Postby gulikoza » 2010-10-24 @ 07:39

Yes, all my patches until now have been committed into cvs.

Can you tell me a bit more about your setup so I can try to recreate the problem?
User avatar
gulikoza
Oldbie
 
Posts: 1700
Joined: 2004-6-25 @ 14:53

Re: Highres rendering patch

Postby Miki Maus » 2010-10-24 @ 11:35

It happens with older version of openglide too. I'm on WinXP SP3, gfx card is integrated nvidia Geforce 8200 kind of equivalent to Geforce 8400 GS.
When I set InitFullScreen to 1 in config file, the game doesn't start fullscreen. It starts in the upper-left corner of the screen like usually but with rest of the screen black.
I'm guessing that changing display mode fails for some reason.

Edit:
Forgot to mention that the game I'm testing with is Ignition which uses 640x400 resolution.
I'll see if I can find some other windows glide game to test with.

Edit2:
Dumb me, just tried and it appears that mode (640x400@any_depth) isn't supported on my system.

Edit3:
Found and tested other games and full screen mode switching with openglide is working normally so it's only problem with Ignition and it's 640x400 mode on my system.
User avatar
Miki Maus
Member
 
Posts: 197
Joined: 2004-10-18 @ 22:19
Location: Cave

Re: Highres rendering patch

Postby gulikoza » 2010-10-25 @ 09:45

What if you use patched version and set a higher resolution?
User avatar
gulikoza
Oldbie
 
Posts: 1700
Joined: 2004-6-25 @ 14:53

Re: Highres rendering patch

Postby Miki Maus » 2010-10-25 @ 17:10

It still doesn't work because apparently my system doesn't support any 16:10 resolution.
It does work if I patch openglide to always make height = width*0.75 when setting fullscreen mode thereby forcing 4:3 aspect ratio.

Edit:
Dumb me, again, now when I checked the source code more thoroughly I saw that you can set width part of the resolution in config file. Then I reread your original post and saw that you mentioned that values above 16 are treated as width. :sweatdrop:

Works perfectly.
User avatar
Miki Maus
Member
 
Posts: 197
Joined: 2004-10-18 @ 22:19
Location: Cave

Re: Highres rendering patch

Postby thedoctor45 » 2010-10-25 @ 18:07

it's working on Mac OS X too :D

as always - nice work gulikoza!
Attachments
carma_hires.png
(1.18 MiB) Downloaded 953 times
User avatar
thedoctor45
Newbie
 
Posts: 37
Joined: 2010-7-12 @ 16:40

Re: Highres rendering patch

Postby wd » 2010-10-26 @ 06:39

You're not going to push him into the cows, are you?
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Highres rendering patch

Postby Dominus » 2010-12-02 @ 01:46

gulikoza, could you upload a compiled version?
I'm currently struggling with running Ultima 9 under Wine (on OS X). Ultima 9 on Wine has the big problem that the game cursor is drawn beneath certain gui elements which makes it very hard to use since you can't handle your inventory and so on... (Wine people know about this, someone filed a bug report ages ago).
Running U9 in glide mode with a glide wrapper has the same problem, EXCEPT for psVoodoo glide wrapper. With psVoodoo you can see the "normal" mosue cursor (the game cursor is still hidden beneath the gui elements) and thus make it work somewhat - seems that psVoodoo has an error there :)
Anyway when testing through the other wrappers (nglide, dgvoodoo, zeckensack), I found that openglide would not work at all (black screen) and wondered whether a newer build would help me there...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7546
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Highres rendering patch

Postby Glidos » 2010-12-02 @ 08:58

I might be interested in fixing the problem with psVoodoo... I didn't know anyone used it for anything other than with Glidos.
User avatar
Glidos
l33t
 
Posts: 3114
Joined: 2002-8-08 @ 02:55

Re: Highres rendering patch

Postby Dominus » 2010-12-02 @ 09:19

;)
I only found it about a year ago, when I last tried to get U9 running. The "problem" with psVoodoo is that it doesn't hide the system cursor, at least on Wine. For me this problem makes psVoodoo the only wrapper that allows me to actually interact with Gui elements like backpack or journal...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7546
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Highres rendering patch

Postby gulikoza » 2010-12-02 @ 09:58

Here's a compiled version...I doubt it will help though it sounds like it would need a specific fix...
Attachments
Glide2x.zip
(76.13 KiB) Downloaded 1103 times
User avatar
gulikoza
Oldbie
 
Posts: 1700
Joined: 2004-6-25 @ 14:53

Re: Highres rendering patch

Postby Dominus » 2010-12-02 @ 10:24

yup, doesn't work at all. The u9 setup doesn't even recognize that there is glide available and U9 itself only makes a flitter on the desktop before disappearing. Worse than the latest release from a few years ago :(
But thanks for providing the binary.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7546
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Highres rendering patch

Postby gulikoza » 2010-12-02 @ 16:48

This is the SDL version, I probably should have mentioned that. You need to make SDL.dll available to wine...
User avatar
gulikoza
Oldbie
 
Posts: 1700
Joined: 2004-6-25 @ 14:53

Re: Highres rendering patch

Postby Dominus » 2010-12-02 @ 18:21

He he, yes that would have helped a lot... I guess it is build on sdl 1.2.14? I'll give it a try later or tomorrow
User avatar
Dominus
DOSBox Moderator
 
Posts: 7546
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Highres rendering patch

Postby Dominus » 2010-12-02 @ 20:07

just tested it. On startup I did get the error message "Severe Problem: OpenGL GL_EXT_packed_pixels extension is required for OpenGlide!" but then the game started and displayed correctly. Seems it doesn't hide the system mouse cursor either... Also I couldn't get the keyboard input to work for some reason. I guess SDL does add some bad things there....

Edit: seriously, I also tried it on an XP VM and it showed the same keybaord input problems... (and also didn'T hide the system cursor)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7546
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg


Return to OpenGLide Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron