Opened 6 months ago

Closed 7 weeks ago

#15486 closed defect (fixed)

TINYGL: triangles always override zbuffer from lines?

Reported by: neuromancer Owned by: neuromancer
Priority: normal Component: Graphics
Version: Keywords:
Cc: Game:

Description

It seems that when using TinyGL, rendering a line on top of a triangle can cause the line to be invisible, depending on the order of the rendering calls. In theory, the rendering order should not matter when depth testing/writing is enabled.
This can be reproduced in the freescape engine, removing workaround for this issue located here: https://github.com/scummvm/scummvm/compare/638af45da0ad...79f7d38f3694#diff-be1a69b059b2d0790b564279ad27cce15d58d9dfe2e7d9d6e9ef7c81c5f5c0f4R362-R373

To reproduce, modify the the affected code to render first planar, then non-planar objects:

	for (auto &pair : offsetMap) {
		pair._key->draw(gfx, pair._value);
	}

	for (auto &obj : nonPlanarObjects) {
		obj->draw(gfx);
	}

Then, load the Total Eclipse CPC demo (https://downloads.scummvm.org/frs/demos/freescape/totaleclipse-cpc-demo.zip), switch the render to software, start the game and examine the plane from different angles.

I have attached two images with and without the workaround.

Attachments (2)

scummvm-totaleclipse-demo-cpc-00001.png (43.6 KB ) - added by neuromancer 6 months ago.
scummvm-totaleclipse-demo-cpc-00000.png (43.4 KB ) - added by neuromancer 6 months ago.

Download all attachments as: .zip

Change History (5)

by neuromancer, 6 months ago

by neuromancer, 6 months ago

comment:1 by neuromancer, 7 weeks ago

A PR with a fix is already available: https://github.com/scummvm/scummvm/pull/6527

comment:2 by Chance.H <chancewithchance@…>, 7 weeks ago

In 159168cb:

FREESCAPE: Fix for #15486 TINYGL: triangles always override zbuffer from lines

comment:3 by neuromancer, 7 weeks ago

Owner: set to neuromancer
Resolution: fixed
Status: newclosed

Finally fixed. Thanks a lot Chance.H!

Note: See TracTickets for help on using tickets.