Skip to content

BG2EE not working on Linux

BarbicanBarbican Member Posts: 3
I'm trying to run BG2EE in my netbook (using Linux), but I'm having performance problems. After starting the game I can navigate the menus without problem, but when I try to play the game itself I experience a massive FPS drop (to 0.1 FPS :D), and it takes more than 5 minutes to do the initial fade in Irenicus' lair. This doesn't look like a hardware problem, since in windows I can play the game perfectly (at least while in the initial room), nor a linux driver problem, since other games, such as Return to Castle Wolfestein, run at maximum quality settings without problem. I've tried as well to force OpenGL version via MESA_GL_VERSION_OVERRIDE, to no avail.

Has anybody experienced these kinds of problems?

Computer info:
CPU: Intel Atom N270 (1.60GHz)
GPU: Intel Corporation Mobile 945GSE Express Integrated Graphics
OS: Debian 8.3 (kernel 3.16.0-4-686-pae), but I've observed the same behaviour with Ubuntu 15.10
Game version: Baldur's Gate 2 Enhanced Edition / 2.0.0.4 / 1.3.2064



log info writter by the game to the console when run with the given opengl flags:



$LIBGL_DEBUG=verbose LIBGL_SHOW_FPS=1 MESA_DEBUG=1 ./start.sh

libGL: screen 0 does not appear to be DRI3 capable
libGL: pci id for fd 4: 8086:27ae, driver i915
libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/tls/i915_dri.so
libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/i915_dri.so
INFO: Creating DPWrapper
INFO: scanning:(18) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/override
INFO: scanning:(16) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/scripts
INFO: scanning:(15) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/sounds
INFO: scanning:(13) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/lang/en_US/sounds
INFO: scanning:(11) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/portraits
INFO: scanning:(10) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/characters
INFO: scanning:(9) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/movies
INFO: scanning:(8) /media/misc/GOG Games/Baldurs Gate 2 Enhanced Edition/game/lang/en_US/movies
INFO: scanning:(6) /home/user/.local/share/Baldur's Gate II - Enhanced Edition/override
INFO: scanning:(5) /home/user/.local/share/Baldur's Gate II - Enhanced Edition/scripts
INFO: scanning:(4) /home/user/.local/share/Baldur's Gate II - Enhanced Edition/sounds
INFO: scanning:(3) /home/user/.local/share/Baldur's Gate II - Enhanced Edition/portraits
INFO: scanning:(2) /home/user/.local/share/Baldur's Gate II - Enhanced Edition/characters
INFO: scanning:(1) /home/user/.local/share/Baldur's Gate II - Enhanced Edition/movies
INFO: gl.useShaders: 1
gl.has_s3tc: 1
gl.has_pvrtc: 0
gl.has_atc: 0
gl.postprocessing: 1
gl.uploadFormat: 0x80E1
gl.uploadType: 0x8367
INFO: Baldur's Gate II - Enhanced Edition v1, 3.2064
libGL: FPS = 25.6
libGL: FPS = 16.1
libGL: FPS = 29.5
libGL: FPS = 17.7
libGL: FPS = 15.0
libGL: FPS = 15.0
libGL: FPS = 15.2
libGL: FPS = 14.9
libGL: FPS = 15.0
libGL: FPS = 28.8
libGL: FPS = 29.9
libGL: FPS = 6.8
libGL: FPS = 26.0
libGL: FPS = 12.0
libGL: FPS = 0.1
libGL: FPS = 0.1
The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list X11 KeyCode 255 (247), X11 KeySym 0x0 ((null)).




glxinfo output:



name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_swap_control
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.4
GLX extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB,
GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) 945GME x86/MMX/SSE2
OpenGL version string: 2.1 Mesa 10.3.2
OpenGL shading language version string: 1.20
OpenGL extensions:
GL_3DFX_texture_compression_FXT1, GL_AMD_shader_trinary_minmax,
GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5,
GL_APPLE_object_purgeable, GL_APPLE_packed_pixels,
GL_APPLE_vertex_array_object, GL_ARB_ES2_compatibility,
GL_ARB_clear_buffer_object, GL_ARB_compressed_texture_pixel_storage,
GL_ARB_copy_buffer, GL_ARB_debug_output, GL_ARB_depth_texture,
GL_ARB_draw_buffers, GL_ARB_draw_elements_base_vertex,
GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location,
GL_ARB_fragment_program, GL_ARB_fragment_shader,
GL_ARB_framebuffer_object, GL_ARB_get_program_binary,
GL_ARB_half_float_pixel, GL_ARB_internalformat_query,
GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment,
GL_ARB_map_buffer_range, GL_ARB_multi_bind, GL_ARB_multisample,
GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_pixel_buffer_object,
GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_provoking_vertex,
GL_ARB_robustness, GL_ARB_sampler_objects, GL_ARB_separate_shader_objects,
GL_ARB_shader_objects, GL_ARB_shading_language_100, GL_ARB_shadow,
GL_ARB_sync, 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_non_power_of_two, GL_ARB_texture_rectangle,
GL_ARB_texture_storage, GL_ARB_transpose_matrix,
GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_binding,
GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader,
GL_ARB_window_pos, GL_ATI_blend_equation_separate, GL_ATI_draw_buffers,
GL_ATI_separate_stencil, GL_ATI_texture_env_combine3, GL_EXT_abgr,
GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_equation_separate,
GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract,
GL_EXT_compiled_vertex_array, GL_EXT_copy_texture,
GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_framebuffer_blit,
GL_EXT_framebuffer_object, GL_EXT_gpu_program_parameters,
GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil,
GL_EXT_packed_pixels, GL_EXT_pixel_buffer_object, GL_EXT_point_parameters,
GL_EXT_polygon_offset, GL_EXT_provoking_vertex, GL_EXT_rescale_normal,
GL_EXT_secondary_color, GL_EXT_separate_specular_color,
GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap,
GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D,
GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_s3tc,
GL_EXT_texture_cube_map, 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_object, GL_EXT_texture_rectangle,
GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, GL_EXT_vertex_array,
GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip,
GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, GL_KHR_debug,
GL_MESA_pack_invert, GL_MESA_window_pos, GL_MESA_ycbcr_texture,
GL_NV_blend_square, GL_NV_light_max_exponent, GL_NV_packed_depth_stencil,
GL_NV_texgen_reflection, GL_NV_texture_env_combine4,
GL_NV_texture_rectangle, GL_OES_EGL_image, GL_OES_read_format,
GL_S3_s3tc, GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp,
GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays

OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.3.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5,
GL_APPLE_texture_max_level, GL_EXT_blend_minmax,
GL_EXT_discard_framebuffer, GL_EXT_map_buffer_range,
GL_EXT_multi_draw_arrays, GL_EXT_read_format_bgra,
GL_EXT_separate_shader_objects, GL_EXT_texture_compression_dxt1,
GL_EXT_texture_filter_anisotropic, GL_EXT_texture_format_BGRA8888,
GL_EXT_texture_type_2_10_10_10_REV, GL_EXT_unpack_subimage,
GL_NV_draw_buffers, GL_NV_fbo_color_attachments, GL_NV_read_buffer,
GL_OES_EGL_image, GL_OES_depth24, GL_OES_depth_texture,
GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,
GL_OES_get_program_binary, GL_OES_mapbuffer, GL_OES_packed_depth_stencil,
GL_OES_rgb8_rgba8, GL_OES_stencil8, GL_OES_surfaceless_context,
GL_OES_texture_3D, GL_OES_texture_npot, GL_OES_vertex_array_object

12 GLX Visuals
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat
----------------------------------------------------------------------------
0x021 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x022 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x075 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x076 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x077 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x078 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow
0x079 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x07a 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x07b 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x07c 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x07d 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow
0x05c 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None

24 GLXFBConfigs:
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat
----------------------------------------------------------------------------
0x05d 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x05e 0 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x05f 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x060 0 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x061 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x062 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x063 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x064 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x065 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x066 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x067 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x068 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow
0x069 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x06a 0 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x06b 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x06c 0 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x06d 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x06e 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x06f 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x070 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x071 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x072 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x073 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x074 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow

Comments

  • little_ducklinglittle_duckling Member Posts: 16
    edited April 2016
    Similar issue here for BG2EE 2.1 via Steam, but not 2.0. I have a similar Intel display controller, and the landscape is black:
    http://redmine.beamdog.com/issues/22793
    Mine:
    OpenGL renderer string: Mesa DRI Intel(R) 945GM x86/MMX/SSE2
    OpenGL version string: 2.1 Mesa 10.3.2
    Yours:
    OpenGL renderer string: Mesa DRI Intel(R) 945GME x86/MMX/SSE2
    OpenGL version string: 2.1 Mesa 10.3.2

    This Intel 945 line is fairly common.

    Were you running 2.0 or a beta? I was running 2.0 with the GraphicsBackend=0 in Baldur.lua and wasn't affected.

    I did see an issue with two shaders which would cause software rasterization (superduper slow rendering) if they were used with this Intel driver, explicitly unrolling their inner loops would fix that issue for the Intel driver. But those shaders weren't in use so fixing them for the Intel mesa driver didn't matter.

    EDIT: Oh, I see you were using 2.0.0.4 (and 1.3.2064).
  • little_ducklinglittle_duckling Member Posts: 16
    Looking elsewhere, you can try turning off the shaders in Baldur.lua:
    SetPrivateProfileString('Graphics','Shaders','0')

    But for me that doesn't appear to work beyond the menu. I get a segfault on a glTexImage2D call on the first in-game frame.
  • little_ducklinglittle_duckling Member Posts: 16
    edited April 2016
    All right, took me a while to figure out what shaders were used during main game. I simplified fpSEAM.glsl and it works for me! I'll try to narrow down exactly what line is the issue.
    Put the attached fpSEAM.glsl in your override folder, and see if it helps your issue.

    OK WTF it says file not allowed. You're going to have to take off the .txt extension after downloading it.

    EDIT: If that doesn't help (which is a strong possibility since you said yours hadn't worked since 1.3) let me know & we can explore the other shaders. The wolfenstein analogy doesn't quite work as different games use different features/shaders. Writing shaders is difficult due to the many different cards/drivers and bugs/features/versions associated.
    Post edited by little_duckling on
  • BarbicanBarbican Member Posts: 3
    edited April 2016
    Wow, and I here I thought I had tried lots of things! :D

    Since my original post GOG has published two versions, 2.0.62 and 2.1.63.

    With 2.0.62 the game runs very slowly without fiddling with the overrides, but at least I get to see the lair and I'm able to navigate the initial conversation with Imoen. Using the modified fpSEAM.glsl doesn't seem to have any effect.

    With 2.1.63 the situation is back to the original (black screen), but using the modified fpSEAM.glsl speeds up things to approximately the same speed of 2.0.62.

    Also, maybe my post was a little misleading. I've never tried version 1.3; under "Game version" I just copied the string shown in the "gameinfo" file in the root directory, right now it shows "2.2.0.6 2.1" (even though the game itself shows "2.1.63", maybe it's a GOG thing).

    Tomorrow I'll try to tinker with apitrace to see whether there's something dodgy; I've just compiled it but it complains about a missing glxtrace.so. Anyway, I'm starting to fear that maybe the Linux version is not that much optimised and my computer is just not able to run it at a decent speed :|
  • little_ducklinglittle_duckling Member Posts: 16
    edited April 2016
    With apitrace you can see any shader compilation warnings/errors by:
    apitrace trace --api gl ./BaldursGateII
    And you can exit the game after clicking through the intro movie as the shaders are compiled at startup.
    Then:
    apitrace replay BauldursGate.trace

    stdout of apitrace replay will show you any GLSL compilation warnings/errors. You'll see the shader program #'s. You'll need to look in the top of the dump to see which shaders those #'s correspond to. A shader program is composed of at least a vertex shader & a fragment shader, both of which will also have a #. e.g.
    vertex shader #1
    fragment shader #2
    shader program #3

    You'll see the text of the shaders in the dump, with the filename as a comment. You can copy that text and put them in a file in the override folder if you want to tweak with them. Only two shader programs were used during the main game rendering for me, #3 and the fpSEAM.glsl one. You may have others active if you have character outlines enabled for example (though I'm assuming you'd disabled those graphics options already).

    To tell which shaders were used in the main rendering loop, I made a trace just loading a game and immediately Alt+F4 exiting. grep the dump for 'glLoadProgram' to see which shaders are used. Different shaders will be used during different states of the game, e.g. intromovie, menu, main-game.

    Also, the Intel Mesa driver has user-space and kernel-space components (the kernel-space component is a kernel module). I'm using Debian Stable 3.16.0-4. If using debian, you can use a newer Intel Mesa driver (11.1.2 instead of 10.3.2) by upgrading to testing/unstable, or even throw unstable on a live-usb, install steam on that and 'ln -s' to your HDD's BG2EE and see if it works on your system before messing with your HDD install (actually I think BG2EE doesn't require steam to run? Try running ./BaldursGateII direct from unstable live-usb). Oh, I talk about it in the last comment on that redmine ticket if you want to look there.
    Post edited by little_duckling on
  • little_ducklinglittle_duckling Member Posts: 16
    edited April 2016
    Oh, and 'ldd BaldursGateII' as a sanity check to make sure your system has all the libraries it might dynamically link to. I was initially missing libjson.so but IIRC the game ran fine without but I installed the relevant debian package anyway.
    apitrace is just one tool in the toolbox too. Looking in the debian package list:
    "intel-gpu-tools - tools for debugging the Intel graphics driver"
    I suppose you could look into that if you don't want to try upgrading to unstable's Intel Mesa.

    And I think this game is optimized fine and should run on your computer if we can get it not to revert to software rasterization (i.e. rendering stuff meant for GPU on the CPU). Hope that the apitrace replay gives a clue. glxtrace.so is probably in one of the libraries apitrace says to install; you don't need the optional libdwarf ones.
  • little_ducklinglittle_duckling Member Posts: 16
    Here are the explicitly unrolled fpSELECT.glsl and fpSprite.glsl files. My Intel Mesa driver had warnings with them saying software rasterization would occur if they were used. With the loops explicitly unrolled I no longer get those warnings. But these shaders weren't used when I run the game, I guess because I didn't have sprite outlines enabled. Hmm I ought to try enabling that.

    Try putting these in the override folder (without the .txt).
  • little_ducklinglittle_duckling Member Posts: 16
    edited April 2016
    Ok, I tried those unrolled ones with Sprite outlines and highlighting enabled, and I had about one game tick/frame every 4 seconds. It's clear to me now that fpSprite.glsl is associated with the black sprite outlines, and fpSELECT.glsl is associated with the sprite highlighting.

    In fpSprite.glsl I changed mSize from 5 to 1 (making kSize=0). I think this makes the black outline 1 pixel wide. Game appeared responsive until I highlighted someone. There was no warning about being unable to flatten the loops as the loops are essentially 'for(int x = 0; x<=0; ++x)'.

    In fpSELECT.glsl I changed kSize from 3 to 1. Still got a warning about the loops as they're 'for(int x=-1; x<=1; ++x)'. Unable to change kSize to 0 as the logic didn't appear to work that way (would result in a divide by zero). I guess that could be further optimized if analyzed further. Responsive now when highlighting. Explicit loop unrolling may help speed things up as I still got that warning.

    For your (and anyone later's) convenience, these are attached (remove the .2.txt extensions, this forum refused to allow me to attach new ones with same name so I put the .2 in there).

    Based on everything I've seen, I'm now guessing this Intel Mesa 10.3.2 driver and/or our hardware has an issue with too many Texture2D calls per fragment (1-2 per fragment seems ok, and seems to really slow down in the 4-25 range). This appears to be the same thing with the fpSEAM.glsl in the redmine ticket I made. Not sure if things would be better with Intel Mesa 11.1.2 and our hardware.

    Per your OP, you say it worked fine on Windows (with outlines enabled and OpenGL not DirectX?). If so, then it must be the 10.3.2 Intel Mesa driver being deficient and not the hardware.

    One optimization they could consider is, given that these are 2D sprites they're post-processing every single frame of a scene, they could move that post-processing step into pre-processing the game assets (so calculate the outline w/ 25 Texture2D calls per fragment once per sprite keyframe). I.e. ship additional sprites with the outlines/highlighting included, making use of the alpha channel. This would meet their goal of supporting older chipsets and additionally hardware that the originals would run on. I wonder if this is how ToEE implemented their blue sprite outlines?
    Post edited by little_duckling on
  • BarbicanBarbican Member Posts: 3

    (though I'm assuming you'd disabled those graphics options already).

    Oh my, I hadn't look into the Graphic Options since my original install, and I could swear that then there wasn't any option to disable Sprite outlines and Highlighting; in fact I was surprised by the meagre number of options. I've just disabled them both and it works now! (using the modified fpSEAM.glsl that you've kindly provided).

    you can use a newer Intel Mesa driver (11.1.2 instead of 10.3.2) by upgrading to testing/unstable, or even throw unstable on a live-usb, install steam on that and 'ln -s' to your HDD's BG2EE and see if it works on your system before messing with your HDD install (actually I think BG2EE doesn't require steam to run? Try running ./BaldursGateII direct from unstable live-usb).

    I tried the original install on Ubuntu 15.10, but I don't remember exactly which version of the driver it used ( I guess that one more recent than the one used by Jessie, though). Anyway, I'll try again (maybe using the new 16.04) and report back. I don't know about the Steam one, but at least the GOG install can be run from a Live CD without problems.

    One optimization they could consider is, given that these are 2D sprites they're post-processing every single frame of a scene, they could move that post-processing step into pre-processing the game assets (so calculate the outline w/ 25 Texture2D calls per fragment once per sprite keyframe). I.e. ship additional sprites with the outlines/highlighting included, making use of the alpha channel. This would meet their goal of supporting older chipsets and additionally hardware that the originals would run on.

    Well, obviously I don't know about the specifics of the game engine, but that certainly makes sense.


    Thanks a lot for all the trouble, mate! You investigation into the problem was most impressive, and thanks to your posts and your redmine ticket I've learnt about some tools (like apitrace) that might come handy in the future. Let me know if I can be of any help trying anything!
Sign In or Register to comment.