flame icon indicating copy to clipboard operation
flame copied to clipboard

`FixedIntegerResolutionViewport` for the `CameraComponent`

Open spydon opened this issue 2 years ago • 2 comments

Problem to solve

When migrating to the CameraComponent an experimental feature called FixedIntegerResolutionViewport was removed, it would be great to re-create this viewport for the CameraComponent.

Proposal

Create FixedIntegerResolutionViewport for the CameraComponent.

More information

This is the old PR for this: #1866

spydon avatar Oct 11 '23 09:10 spydon

Hi @spydon what you expect that FixedIntegerResolutionViewport do?

As I understand this it should deal better on Pixel Art games, that's why has a Fixed Pixel Ratio on 1.0, right?

But still not clear for me why we need to create a specific class for that, If we do a FixedResolutionViewport(resolution: Vector2(1,1)) wouldn't work that same as you are proposing?

I would love to be able to understand better and contribute to the project, if you have a little patience to explain, I would appreciate it.

Arthurlima544 avatar Oct 13 '23 00:10 Arthurlima544

Hi @spydon what you expect that FixedIntegerResolutionViewport do?

When it scales the viewport or should only scale so that the size is corresponding to real integer pixel values.

As I understand this it should deal better on Pixel Art games, that's why has a Fixed Pixel Ratio on 1.0, right?

What do you mean with "fixed pixel ratio on 1.0"? Yeah, it would work a bit better on pixel art games, but first and foremost it was built to avoid a anti-alias bug in non-impeller rendering (#1152).

But still not clear for me why we need to create a specific class for that, If we do a FixedResolutionViewport(resolution: Vector2(1,1)) wouldn't work that same as you are proposing?

That wouldn't work, that would only show one single pixel on the whole screen, and you also want to be able to have different aspect ratios.

spydon avatar Oct 13 '23 07:10 spydon