Opened 21 years ago

Closed 21 years ago

Last modified 5 years ago

#8251 closed patch

OpenGL fixes

Reported by: SF/luke_br Owned by: Kirben
Priority: normal Component: Graphics
Version: Keywords:
Cc: Game:

Description

Fixed: 1. Black borders 2. Bottom line 3. Vertical black line 4. 320x240 games (no aspect change possible) 5. Switching to GL mode corrected (Bilinear Filter activation). 6. Added more comments for better understanding.

Comments: 1. if you want to ditch the code, no problem. 2. FB2GL_320 when set would use 2 textures. If not set then would just use one texture (256x256). 3. I am still going to add the option to use one 512x256 texture (modern 3d video cards). 320x256 texture I think will not work. 4. The vertical black line is caused by a gap between the two textures (256x256). See the variable texture1_end (fb2opengl.h) 5. blit16() is just for ScummVM, and needs the flag FB2GL_NO_320. The other flags may not work with this method. For non-scummvm use update().

Ticket imported from: #762815. Ticket imported from: patches/356.

Attachments (4)

fb2opengl.patch (4.5 KB ) - added by SF/luke_br 21 years ago.
fb2opengl fixes
sdl_gl.patch (3.0 KB ) - added by SF/luke_br 21 years ago.
sdl_gl.cpp fixes
sdl_gl.2.patch (3.6 KB ) - added by SF/luke_br 21 years ago.
hotswap & aspect ratio => fixed
sdl_gl.3.patch (1.3 KB ) - added by SF/luke_br 21 years ago.
Patch on latest CVS source code

Download all attachments as: .zip

Change History (17)

by SF/luke_br, 21 years ago

Attachment: fb2opengl.patch added

fb2opengl fixes

by SF/luke_br, 21 years ago

Attachment: sdl_gl.patch added

sdl_gl.cpp fixes

comment:1 by Kirben, 21 years ago

Added patch to ScummVM cvs, only problems left are: Curse of Monkey Island crashing when OpenGL filter is used. The aspect ratio with OpenGL filter is lost when switching ScummVM from window size to full screen size.

comment:2 by Kirben, 21 years ago

Owner: set to Kirben

comment:3 by SF/luke_br, 21 years ago

I have tested on a Voodoo3 and a GeForce2 and everything is working fine. The aspect ratio isn't lost when switching from window size to full screen size. And it doesn't crash with Curse of Monkey Island (monkeyvga). Could you please use a debbuger and tell me where the problem is? Thanks

comment:4 by Kirben, 21 years ago

Thats strange, I'm using a GeForce 2 MX based video card too with Windows XP. The Curse of Monkey Island uses the comi target.

comment:5 by fingolfin, 21 years ago

On Mac OS X, starting scummvm+comi with the GL backend produces this OS message: *** malloc_zone_malloc[16679]: argument too large: -286720 then it goes on. Pressing Ctrl-Alt-A causes a seg fault. Note that with COMI, there shouldn't be done any aspect ration "correction", because the aspect ratio is already correct. Strecthing it vertically would make the ratio *wrong*.

comment:6 by fingolfin, 21 years ago

The black vertical line is still there, in bilinear mode. It was gone in "normal" mode already (I fixed that some time ago). Also your comment on this in the code is techincally incorrect ("Note: wrong value may cause black vertical line (gap) between texture1 and texture2 in the X axis").

The problem is not caused by an incorrect value; rather, it's caused because of the bilinear filtering and the use of two textures: obviously the pixel column at the very border of the textures has nothing on one of its sides with which it can interpolate. The only fix for this behaviour would be to use the texture border feature of OpenGL.

comment:7 by Kirben, 21 years ago

Have you check out the aspect ratio problem with the hotswap_gfx_mode() function enabled ? rather than the default of using SDL_WM_ToggleFullScreen().

comment:8 by SF/luke_br, 21 years ago

I have fixed the aspect ratio problem with hotswap_gfx_mode(). The other option for the border of the texture is to use GL_REPEAT instead of GL_CLAMP. But when using the first option you get the vertical line, even if running scummvm under Linux. Gl_CLAMP works fine in both 3d cards that I told you when running scummvm under Linux. It looks like the Windows version have some problems with GL_CLAMP. I can't find a simple solution. So, this weekend I will try to make the 512x256 texture rendering version.

by SF/luke_br, 21 years ago

Attachment: sdl_gl.2.patch added

hotswap & aspect ratio => fixed

by SF/luke_br, 21 years ago

Attachment: sdl_gl.3.patch added

Patch on latest CVS source code

comment:9 by fingolfin, 21 years ago

Note that I am not using windows, I am using OpenGL on Mac OS X; and the black line is *exactly* the correct behaviour if using GL_CLAMP in the SDL code. If you don't get it on some system, that would indicate that your system is using a buggy OpenGL implementation.

comment:10 by fingolfin, 21 years ago

Why is this item still open? While there are still open issues with the GL backend, any patch for them should be submitted in a separate new tracker item. The only reason to keep this open would be if we have to discuss reverting the patch, which doesn't seem to be the case...

comment:11 by Kirben, 21 years ago

OK, just thought one patch item for OpenGL fixes might have been easier. Closing now...

comment:12 by Kirben, 21 years ago

Status: newclosed

comment:13 by digitall, 5 years ago

Component: Graphics
Note: See TracTickets for help on using tickets.