Skip to content

Conversation

@AlexAPPi
Copy link
Contributor

@AlexAPPi AlexAPPi commented Oct 1, 2025

Fixed min and mag filter for matrices texture.
Some devices were reading the texture incorrectly.

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

@AlexAPPi AlexAPPi changed the title Fixed min amd mag filter for matrices texture Fixed min and mag filter for matrices texture Oct 1, 2025
Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unexpected as textureFetch should completely ignore sampler.
No harm though.

In that case lets add addressing as well

            addressU: ADDRESS_CLAMP_TO_EDGE,
            addressV: ADDRESS_CLAMP_TO_EDGE

@AlexAPPi
Copy link
Contributor Author

AlexAPPi commented Oct 1, 2025

That's unexpected as textureFetch should completely ignore sampler. No harm though.

In that case lets add addressing as well

            addressU: ADDRESS_CLAMP_TO_EDGE,
            addressV: ADDRESS_CLAMP_TO_EDGE

I also thought that this would not affect, but when specifying filters, the example worked on my test phone.

@AlexAPPi
Copy link
Contributor Author

AlexAPPi commented Oct 1, 2025

image

Iphone 11 (IOS 17)

@willeastcott willeastcott requested a review from Copilot October 1, 2025 11:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes texture filtering for matrices texture to resolve rendering issues on some devices. The change ensures that texture data is read correctly by disabling interpolation and clamping texture coordinates.

  • Added nearest neighbor filtering (minFilter and magFilter) to prevent interpolation of matrix data
  • Added clamp-to-edge addressing to prevent texture coordinate wrapping

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mvaligursky
Copy link
Contributor

That works on WebGL .. or does that fix WebGPU as well?

@mvaligursky mvaligursky merged commit 4619f0e into playcanvas:main Oct 1, 2025
7 checks passed
@AlexAPPi AlexAPPi deleted the alex-fix-md-mp-example-tex-filter branch October 1, 2025 11:36
@AlexAPPi
Copy link
Contributor Author

AlexAPPi commented Oct 1, 2025

That works on WebGL .. or does that fix WebGPU as well?

I switched to WebGPU and rebooted my phone, now I get a black screen...

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

Successfully merging this pull request may close these issues.

3 participants