Opened 19 months ago

Last modified 11 months ago

#14452 new defect

TETRAEDGE: Syberia 1/2 very slow video rendering issues in menus

Reported by: dwatteau Owned by:
Priority: normal Component: Engine: Tetraedge
Version: Keywords: performance, theora
Cc: Game: Syberia 1

Description

I have a late PowerBook G4 running OSX Leopard, Debian and OpenBSD. I'm testing the Syberia 1 & 2 Macintosh games from GOG with a recent build from the master branch.

The games do start, but there are various rendering issues (see the attached screenshots) and moreover everything is extremely slow (whether in OpenGL or TinyGL mode), to the point that even moving the cursor to the small hitbox of the "New game" or "OK" buttons takes ages.

For some reason, Syberia 2 has a more tolerable framerate than Syberia 1. Maybe it's related to the bigger video in the menu for Syberia 1? For reference, Grim Fandango, Escape from Monkey Island and The Longest Journey run pretty well on the same machine.

I'm attaching some logs for reference. Some come from the Instruments and OpenGL Profiler OSX apps. Looking at top, it looks like the game is being quite CPU-bound.

Attachments (9)

Instruments ScummVM CPU.trace.zip (586.6 KB ) - added by dwatteau 19 months ago.
OSX trace from the Instruments app
opengl-profiler-syberia-macppc-trace.txt.gz (5.0 KB ) - added by dwatteau 19 months ago.
OpenGL Profiler trace for Syberia (gzip'd because it's big)
opengl-profiler-syberia-macppc-function-calls.txt (1.1 KB ) - added by dwatteau 19 months ago.
OpenGL Profiler function calls for Syberia
syberia-macppc1.png (527.1 KB ) - added by dwatteau 19 months ago.
Syberia 1 rendering issues in the menu (1/2)
syberia-macppc2.png (492.1 KB ) - added by dwatteau 19 months ago.
Syberia 1 rendering issues in the menu (2/2)
syberia2-macppc.png (652.2 KB ) - added by dwatteau 19 months ago.
Syberia 2 rendering issues in the menu
scummvm_d6_syberia_osx_leopard.txt (2.5 KB ) - added by dwatteau 19 months ago.
ScummVM -d6 output from OSX Leopard
scummvm_d6_syberia_openbsd69.txt (6.0 KB ) - added by dwatteau 19 months ago.
ScummVM -d6 output from OpenBSD on the same machine
instruments-scummvm-cpu-tetraedge-macppc.png (103.8 KB ) - added by dwatteau 18 months ago.
Tetraedge CPU usage in Instruments 1.5 on OSX Leopard PPC

Change History (14)

by dwatteau, 19 months ago

OSX trace from the Instruments app

by dwatteau, 19 months ago

OpenGL Profiler trace for Syberia (gzip'd because it's big)

by dwatteau, 19 months ago

OpenGL Profiler function calls for Syberia

by dwatteau, 19 months ago

Attachment: syberia-macppc1.png added

Syberia 1 rendering issues in the menu (1/2)

by dwatteau, 19 months ago

Attachment: syberia-macppc2.png added

Syberia 1 rendering issues in the menu (2/2)

by dwatteau, 19 months ago

Attachment: syberia2-macppc.png added

Syberia 2 rendering issues in the menu

by dwatteau, 19 months ago

ScummVM -d6 output from OSX Leopard

by dwatteau, 19 months ago

ScummVM -d6 output from OpenBSD on the same machine

comment:1 by mduggan, 19 months ago

Thanks for all the data. I haven't done anything to optimize the video render path and it involves a few copies, so I'm sure it can be improved.

Unfortunately it seems Instruments is not backward-compatible because it won't open that trace on my Mac, but I can probably improve things anyway just by looking at the TeTheora->TeImage->Te3DTexture copies.

As for the graphic corruption, they look like classic endian-ness mistakes somewhere (probably in the use of TeColor class as direct data for GL) so I can probably look into those too.

by dwatteau, 18 months ago

Tetraedge CPU usage in Instruments 1.5 on OSX Leopard PPC

comment:2 by dwatteau, 18 months ago

Thank you for looking into this!

Yes, indeed it looks like newer versions of Instruments can't load older .trace files. Here's a screenshot of the main points of CPU usage, if I understand this tool properly (I'm not very used to it).

comment:3 by dwatteau, 18 months ago

FWIW, the menu now renders correctly (as far as I can say) with this PR: <https://github.com/scummvm/scummvm/pull/5035>, but the embedded videos inside them are still quite slow, especially in Syberia 1 where it prevents me from reaching the "New game" button.

Otherwise, the games appear to work correctly on big-endian, from a quick test :)

So yeah, there's maybe something to be optimized around TeTheora.

comment:4 by dwatteau, 16 months ago

Keywords: performance theora added; big endian removed
Summary: TETRAEDGE: Syberia 1/2 rendering issues on big-endianTETRAEDGE: Syberia 1/2 very slow video rendering issues in menus

comment:5 by ccawley2011, 11 months ago

The big endian fix mentioned in the previous post looks like it should also be applied in quite a few other places in the Tetraedge engine where Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24) is used unconditionally.

Note: See TracTickets for help on using tickets.