Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few visual problems in the flash clip #2241

Closed
Diatonator opened this issue Jan 4, 2021 · 6 comments
Closed

A few visual problems in the flash clip #2241

Diatonator opened this issue Jan 4, 2021 · 6 comments
Labels
A-rendering Area: Rendering & Graphics

Comments

@Diatonator
Copy link

Diatonator commented Jan 4, 2021

Chrome 87.0.4280.88
Tested on nightly builds 2020_12_15 and 2021_01_03

https://z0r.de/1656

image

This flash has a few problems

  1. No text on the left-bottom:
    image

I bet the "string data" error is related to this, and probably it's the '(c)' character.

  1. At the end of a flash loop (around 20-30 sec in) you will see a two highly distorted "spartans" emerging from the earth:

Adobe:
1656_Adobe

Ruffle:
1656_Ruffle

I believe those distorted are the "spartans" which were used in a different way in this flash. The first distorted one got the "talking mouth", and you can actually see that mouth undistorted, and another distorted one got another head attached to him.

I actually seen the similar distortion in this flash:

https://z0r.de/2264 (EPILEPSY WARNING)
image

@Toad06
Copy link
Member

Toad06 commented Jan 4, 2021

1/ This is a SWFv5 text-decoding issue, just like #2043.

2/ This one is more mysterious. On the desktop backend (Windows), a bunch of errors are logged before the file actually plays: ERROR ruffle_render_wgpu] Tessellation failure: TooManyVertices.
renderer

@Toad06 Toad06 added the A-rendering Area: Rendering & Graphics label Jan 4, 2021
@torokati44
Copy link
Member

torokati44 commented Jan 4, 2021

In at least https://z0r.de/2264 there is a shape with so many complex paths that register_shape_internal indeed ends up producing a mesh with something like 130k vertices* (if I checked it right), and an u16 index format can't deal with that - or maybe it just trips an artificial limitation for sanity. For the non-GPU paths this is not a problem, because with those, the meshes never have to be serialized into IBOs/VBOs. (In fact, there should not be any tessellation with those at all?)

  • Switching to wgpu::IndexFormat::Uint32 might help, but this might also have performance implications.
  • Or, register_shape_internal could also split up these extremely complex shapes into several smaller Meshes, and return a Vec?

I also tried increasing the curve approximation tolerances for both fills and strokes, but the paths themselves are made up of so many elements (which are not curves) that it didn't make much of a difference.

[*]: Maybe it was auto-vectorized from a noisy bitmap or something like that? I haven't checked if this is how it is actually stored in the .SWF or it's something that ends up happening at runtime. By the looks of it, https://z0r.de/1656 also has something like this.

@Herschel
Copy link
Member

Herschel commented Jan 5, 2021

Bad triangulation fixed by #2264. These types of graphics are usually made with the "Trace Bitmap" function in the Flash software. Bumped the index format to u32, this should be fine. This was on my todo list for a while, kept forgetting about it!

@Diatonator Could you file a separate issue for the text problem? Thank you!

@Herschel Herschel closed this as completed Jan 5, 2021
@Diatonator
Copy link
Author

@Herschel done #2283

@Diatonator
Copy link
Author

I'll also test here as I get the build with the changes:
http://eye.swfchan.com/flash.asp?id=4473&n=1285.swf

The output now at some parts is hilarious
swfchan_id4473

@torokati44
Copy link
Member

torokati44 commented Jan 5, 2021

Couldn't see a single graphical glitch now with this .swf either, at least on desktop, with the Vulkan backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rendering Area: Rendering & Graphics
Projects
None yet
Development

No branches or pull requests

4 participants