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

gsdx ogl: add an HLE shader to avoid upscaling line in ICO #1854

Merged
merged 1 commit into from Mar 16, 2017

Conversation

Projects
None yet
4 participants
@gregory38
Copy link
Contributor

commented Mar 11, 2017

ICO uses a depth of field effect for the fog. Depth is extracted
into the alpha channel of a texture. And then used as blending factor.
You need a 1:1 texture/pixel mapping otherwise you will line at boundaries.

In order to extract the DoF, ICO moves the depth buffer around the GS
memory. Memory moves are implemented in the not-scaled world. It means
that we can't have the above 1:1 ratio. And we don't know anymore that
data are coming from the current depth buffer.

The solution: I added a dedicated shader to read the depth buffer directly.
This way I have the guarantee that pixel/depth are aligned.

Close #1816

@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Mar 11, 2017

@prafullpcsx2 a 🎁 for you 😄

@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Mar 11, 2017

I forget to say you need at least CRC hack on minimum.

@FlatOutPS2

This comment has been minimized.

Copy link
Member

commented Mar 11, 2017

I forget to say you need at least CRC hack on minimum.

And below Full, otherwise the effect will be disabled.

@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2017

Actually maybe I can reuse others part of shader

  • PS_DEPTH_FMT == 1 or 2
  • PS_CHANNEL_FETCH == 3

It would reduce the size of the PR.

@gregory38 gregory38 force-pushed the greg/ico-upscaling branch Mar 12, 2017

gsdx ogl: use an HLE shader to avoid upscaling line in ICO
ICO uses a depth of field effect for the fog. Depth is extracted
into the alpha channel of a texture. And then used as blending factor.
You need a 1:1 texture/pixel mapping otherwise you will line at boundaries.

In order to extract the DoF, ICO moves the depth buffer around the GS
memory. Memory moves are implemented in the not-scaled world. It means
that we can't have the above 1:1 ratio. And we don't know anymore that
data are coming from the current depth buffer.

The solution: I reused an HLE channel shader to read the depth buffer directly.
This way I have the guarantee that pixel/depth are aligned.

Close #1816

@gregory38 gregory38 force-pushed the greg/ico-upscaling branch to 37c17fa Mar 12, 2017

@prafullpcsx2

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2017

Thanks for the gift @gregory38.

ICO works great now.

Edit: Sorry deleted some info as it was wrong.

@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2017

Honestly I would be surprised it works well for other games. Tbh I even surprised that it didn't break ICO. So far, when we have a display texture that is blended, the hack will sample from the current depth instead of the texture. It "works" because the texture is the depth that was moved. However I don't have any guarantee that it isn't a color buffer instead.

Note for myself​: check that current texture isn't already a known color/depth buffers. Might avoid some bad cases.

@gregory38 gregory38 merged commit a3efc77 into master Mar 16, 2017

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@gregory38 gregory38 deleted the greg/ico-upscaling branch Mar 16, 2017

@lightningterror

This comment has been minimized.

Copy link
Member

commented Mar 5, 2018

Honestly I would be surprised it works well for other games.

Which other games do you think it can work for ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.