Dodgy Textures

Technical support for all issues relating to Defcon Linux

Moderator: Defcon moderators

User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Wed Jan 28, 2009 7:41 am

Just unpack main.dat and rescale the textures to 512x512.
KIAaze
level0
Posts: 4
Joined: Sun Jun 29, 2008 1:57 am

Postby KIAaze » Mon May 11, 2009 1:26 pm

Resizing the textures to powers of 2 didn't help.

I'm having the exact same problem. I have an ATI Radeon IGP 345M and am using Ubuntu 9.04.
I even changed the mouse image in main.dat, but it still showed the same big white cursor over the map, so it seems to somehow take the texture from the normal mouse cursor.

I'll post more info later when I'm back on my own PC.

Note: I also have some random graphic glitches with the world map in Uplink.
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Mon May 11, 2009 1:40 pm

Try smaller texture sizes, like 256x256. That's all I can think of apart from bugging the driver authors to have a look at the problem.
KIAaze
level0
Posts: 4
Joined: Sun Jun 29, 2008 1:57 am

Postby KIAaze » Mon May 11, 2009 2:28 pm

Well, the introversion devs could also just code in a texture resizing function into the game... (or ship it with alternate power of two textures)

A lot of openGL games run well on my PC (including Darwinia), so I believe it's possible to solve this problem without changing drivers.

That's what we did for the GP2D engine (altough it seems to have changed now): http://gamepower.sourceforge.net/en/index.php
cf also: http://code.google.com/p/pygl2d/issues/detail?id=1
(both GPL, but it shouldn't be too hard for introversion devs to code something like that. :P)

But if the mouse texture is power of 2, then it must be another problem. I'll try to find out as soon as I can.
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Mon May 11, 2009 2:59 pm

Don't hold your breath for code changes adapting Defcon to your hardware, especially not if making the change you request (resizing the texture) manually doesn't work.
KIAaze
level0
Posts: 4
Joined: Sun Jun 29, 2008 1:57 am

Postby KIAaze » Mon May 11, 2009 10:21 pm

Ok, so it seems I made a mistake the first time and the original textures were used:
I extracted the contents of main.dat, modified them and recompressed the archive.

However, there was a normal data folder in the lib directory which contained the original images (earlier extraction attempt I think).

Anyway, I fixed this and this time my modified cursor showed up, meaning the power of two textures were used.
The bug was still there, so it's unfortunately not just a NPOT texture problem. :(

Glitches I experience:
-When I middle-click on the map to move it, a font grid appears.
-I also see the font grid in the join game dialog instead of the world map.
-My current cursor (arrow or moving cross) is always superimposed on the world map during play.
-Moving the mouse over units/buildings changes their texture (ex: fighters become missiles)
-Some units have the wrong texture (ex: silo looks like a nuke)
-Yellow flickering onscreen

Is the code for defcon available somewhere? (like the code for Uplink for example)

Defcon version: 1.42

My glxinfo output:

Code: Select all

$ glxinfo -v
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_visual_select_group
client glx vendor string: SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory,
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control,
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_MESA_swap_control, GLX_MESA_swap_frame_usage, GLX_OML_swap_method,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_visual_select_group
OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Mesa DRI Radeon 20061018 AGP 4x x86/MMX/SSE2 NO-TCL
OpenGL version string: 1.3 Mesa 7.4
OpenGL extensions:
    GL_ARB_imaging, GL_ARB_multisample, GL_ARB_multitexture,
    GL_ARB_texture_border_clamp, GL_ARB_texture_compression,
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar,
    GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat,
    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix,
    GL_ARB_vertex_buffer_object, GL_ARB_window_pos, GL_EXT_abgr, GL_EXT_bgra,
    GL_EXT_blend_color, GL_EXT_blend_logic_op, GL_EXT_blend_minmax,
    GL_EXT_blend_subtract, GL_EXT_clip_volume_hint,
    GL_EXT_compiled_vertex_array, GL_EXT_convolution, GL_EXT_copy_texture,
    GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_histogram,
    GL_EXT_packed_pixels, GL_EXT_polygon_offset, GL_EXT_rescale_normal,
    GL_EXT_secondary_color, GL_EXT_separate_specular_color,
    GL_EXT_stencil_wrap, GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D,
    GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add,
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias,
    GL_EXT_texture_mirror_clamp, GL_EXT_texture_object,
    GL_EXT_texture_rectangle, GL_EXT_vertex_array, GL_APPLE_packed_pixels,
    GL_ATI_texture_env_combine3, GL_ATI_texture_mirror_once,
    GL_IBM_rasterpos_clip, GL_IBM_texture_mirrored_repeat,
    GL_MESA_ycbcr_texture, GL_MESA_window_pos, GL_NV_blend_square,
    GL_NV_light_max_exponent, GL_NV_texture_rectangle,
    GL_NV_texgen_reflection, GL_OES_read_format, GL_SGI_color_matrix,
    GL_SGI_color_table, GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp,
    GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod

16 GLX Visuals
Visual ID: 21  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 22  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 66  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 67  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 68  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 69  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 6a  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 6b  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 6c  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 6d  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 6e  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 6f  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 70  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 71  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 72  depth=24  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 55  depth=32  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.

16 GLXFBConfigs:
Visual ID: 56  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 57  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 58  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 59  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 5a  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 5b  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 5c  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 5d  depth=0  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 5e  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 5f  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 60  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 61  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=0
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 62  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 63  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=0 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.
Visual ID: 64  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=0 greenSize=0 blueSize=0 alphaSize=0
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
Visual ID: 65  depth=0  class=DirectColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=8
    auxBuffers=0 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=Slow
    Opaque.



P.S.:
Just in case others would like to try out resizing the textures, here's what I used:

Code: Select all

cd lib
unrar x main.dat
find . -name *.bmp | xargs -n1 ~/bin/POTify.py
rar a -R main.dat ./data/


The ~/bin/POTify.py script to resize an image to the next power of two if necessary (requires imagemagick):

Code: Select all

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
from subprocess import Popen
from subprocess import PIPE
import re
from math import log, ceil
 
def is_power_of_2(n):
    return log(n, 2) % 1.0 == 0.0
 
def next_power_of_2(n):
    return int( (2 ** ceil(log(n, 2))) )

def resize_to_POT(image):
  bla = Popen(["identify", image], stdout=PIPE).communicate()[0]
  #print bla
  m = re.match(r".*?(\d+)x(\d+).*", bla)
  #print m.groups()
  width=int(m.group(1))
  height=int(m.group(2))
  #print width
  #print height
  if not is_power_of_2(width) or not is_power_of_2(height):
    new_width=next_power_of_2(width)
    new_height=next_power_of_2(height)
    #print new_width
    #print new_height
    cmd='mogrify -resize ' + str(new_width) + 'x' + str(new_height) + '\! ' + image
    print cmd
    os.system(cmd)
  else:
    print image+' is POT: '+str(width)+'x'+ str(height)

resize_to_POT(sys.argv[1])
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Tue May 12, 2009 12:44 am

First bit of advice: DO NOT rar the data directory. Defcon will read directly out of the data directory, so there is no need to rar it, and there is the potential to cause problems (i.e. by not raring it correctly, or by still having data in the data directory).

xander
User avatar
carebear
level3
level3
Posts: 281
Joined: Mon Jul 18, 2011 1:31 pm
Location: Eric Somana est un faux-cul

Postby carebear » Thu Jan 05, 2012 4:59 pm

for bug diggers, or artists .. :X

http://forums.introversion.co.uk/defcon ... 473#113473 ...

:p

Return to “Linux Troubleshooting”

Who is online

Users browsing this forum: No registered users and 5 guests