bugBos Wars - Bugs: bug #28727, Too large textures slow down OpenGL

 
 

bug #28727: Too large textures slow down OpenGL

Submitted by:  Kalle Olavi Niemitalo <kon>
Submitted on:  Sun 24 Jan 2010 09:20:37 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: François Beerten <feb>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 28 Feb 2010 02:26:08 PM UTC, comment #2:

Applied in SVN. Thanks a lot for the report and the patch.

As said on IRC, it also makes OpenGL useable on my machine. I wonder if we should set a default override of 512 like you suggested.

François Beerten <feb>
Project AdministratorIn charge of this item.
Mon 15 Feb 2010 10:22:23 PM UTC, comment #1:

The default behavior in Bos should be to use the value reported by the video card driver as it currently does. A new config value can be added to override the value in your case.

Jimmy Salmon <jsalmon3>
Sun 24 Jan 2010 09:20:37 PM UTC, original submission:

If I enable OpenGL in the video options and start a game on bridge.map, it runs too slowly. The mouse cursor does not move smoothly at all. This even happens while the game is paused or some menu is active. However, there is no such problem with islandwar.map. If I disable OpenGL, then both maps run fast enough.

The problem seems to be bridge.map uses a 4096x4096 terrain.png as its background, and islandwar.map uses only 2048x2048. Bos Wars creates one large OpenGL texture for the 4096x4096 image and that is apparently too big for the video driver or card to properly accelerate.

When Bos Wars starts up, it asks OpenGL for the maximum texture size and saves that in GLMaxTextureSize. It then splits large images into multiple smaller textures if they don't fit. However, Mesa here reports 4096 as the maximum size, and maps/bridge.map/terrain.png is 4096x4096, so it fit and Bos Wars does not split it. This is not a bug in Mesa because it does correctly draw the 4096x4096 texture, albeit slowly.

I think Bos Wars should either limit GLMaxTextureSize to e.g. 512 if OpenGL reports a larger value, or allow the user to configure the value.

Debian testing, Bos Wars trunk r9623 debug, libsdl1.2debian 1.2.13-5, xserver-xorg 1:7.4+4, xserver-xorg-video-ati 1:6.12.3-1, xserver-xorg-video-radeon 1:6.12.3-1, xserver-xorg-video-radeonhd 1.2.5-1, libgl1-mesa-dri 7.6.1-1, linux-image-2.6.32-trunk-amd64 2.6.32-5, Acer Aspire 5536G, ATI Mobility Radeon HD 4570, 512 MB video memory of which 256 MB visible to CPU.

Kalle Olavi Niemitalo <kon>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #19749:  0001-Add-MaxOpenGLTexture-preference.patch added by kon (6KiB - text/x-patch - This does not check whether the user specified a power of 2.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by feb (Posted a comment)
  • -unavailable- added by kon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 21 Mar 2010 04:12:35 PM UTCfebOpen/ClosedOpen=>Closed
    Sun 28 Feb 2010 02:26:08 PM UTCfebStatusNone=>Fixed
      Assigned toNone=>feb
    Sat 20 Feb 2010 12:41:38 AM UTCkonAttached File-=>Added 0001-Add-MaxOpenGLTexture-preference.patch, #19749

    Back to the top


    Powered by Savane 3.1-cleanup1