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

Blur results when using exported app html #290

Open
LaFeuilleMorte opened this issue Nov 15, 2024 · 12 comments
Open

Blur results when using exported app html #290

LaFeuilleMorte opened this issue Nov 15, 2024 · 12 comments

Comments

@LaFeuilleMorte
Copy link

Hi, I've noticed an obvious blurriness when using the exported app html to render my ply. Here're the comparation:

Using Editor:
image

Using exported HTML:
image

As I take a deeper look into the code. The compressed ply will drop the SH values to save more bytes. And this is the same with the exported app html. Both the rendering results above were using compressed ply format. So I don't know why there's a big gap between these two formats. Is the app.html rendering pipeline different from that of the editor? Looking forward to your reply.

@slimbuck
Copy link
Member

If these are both compressed models, then the likely culprit is devicePixelRatio. Perhaps @willeastcott can confirm?

@LaFeuilleMorte
Copy link
Author

devicePixelRatio

I viewed and log the devicePixelRatio variable in the console and found that in the editor: the value=1.8, while in the app.html, the value=2.0. Could that be the root cause?

@slimbuck
Copy link
Member

I guess the two windows were on two different screens? This difference is close enough that it shouldn't make a difference.

However PlayCanvas can be configured to use devicePixelRatio or not. If not then then rendered image will be lower res (so more blurry).

It's possible the editor project is configured to use devicePixelRatio and viewer.html not.

@LaFeuilleMorte
Copy link
Author

I guess the two windows were on two different screens? This difference is close enough that it shouldn't make a difference.

However PlayCanvas can be configured to use devicePixelRatio or not. If not then then rendered image will be lower res (so more blurry).

It's possible the editor project is configured to use devicePixelRatio and viewer.html not.

No, they are displayed on same browser and same screen. Mine is Mac M3. BTW, how to enable devicePixelRatio in viewer.html

@slimbuck
Copy link
Member

Not sure, but @willeastcott can help (assuming the issue is DPR).

@willeastcott
Copy link
Contributor

willeastcott commented Nov 15, 2024

Try changing <pc-app> to <pc-app high-resolution> in the exported html. Does that help?

@LaFeuilleMorte
Copy link
Author

Try changing to in the exported html. Does that help?

Seemed not changing. Maybe I can send it to you to debug.

cropped_mcmc_nov15.debug-viewer.html.zip

@slimbuck
Copy link
Member

Are you able to provide us the editor project to compare? Thanks!

@willeastcott
Copy link
Contributor

Yeah, it'd be useful to have the PLY.

@LaFeuilleMorte
Copy link
Author

LaFeuilleMorte commented Nov 15, 2024

cropped_mcmc_nov15.debug.compressed.ply.zip
OK,It's a compressed format. And I've found the blurry issue seemed to be much worse in mobile phones and my Mac computer (Perhaps due to the high pixel density?) While on my HDMI screen, this issue will be much mitigated

@willeastcott
Copy link
Contributor

Ah, I see what's happening:

  1. SuperSplat is rendering at the device's physical resolution:
    this.app.graphicsDevice.maxPixelRatio = window.devicePixelRatio;
  2. The HTML viewer is rendering at the device's CSS resolution. And the high-resolution attribute is broken in version 0.1.3 of the PlayCanvas Web Components. I've just submitted a fix here: Add more pc-app attributes web-components#52

I'll now submit a PR that updates SuperSplat to the latest version of the Web Components.

@slimbuck, are you happy for the viewer to render at physical resolution? Any concerns about performance?

@slimbuck
Copy link
Member

Performance might suffer so we'll ultimately make it an export option. For now I think it's probably fine though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants