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

WebGLRenderer: Use texelFetch() to sample morph target texture. #23727

Merged
merged 2 commits into from
Mar 15, 2022

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 15, 2022

Related issue: #23711

Description

@kenrussell recommended the usage of texelFetch() to sample the morph target texture (see https://bugs.chromium.org/p/chromium/issues/detail?id=1305968#c4). This actually solves the issue reported in #23711 on a Windows laptop 🎉 .

Looking at the details of texelFetch(), it's indeed the more appropriate function for this use case.

@LeviPesin
Copy link
Contributor

Was the issue emerging from that it was written x + 0.5 and y? Should it had been written as x + 0.5 and y + 0.5?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Mar 15, 2022

No, I don't think so.

@mrdoob mrdoob added this to the r139 milestone Mar 15, 2022
@mrdoob mrdoob merged commit 3fcefcc into mrdoob:dev Mar 15, 2022
@mrdoob
Copy link
Owner

mrdoob commented Mar 15, 2022

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Mar 15, 2022

TIL about texelFetch()... @elalish were you aware of it when looking for texture2d() alternatives?

@elalish
Copy link
Contributor

elalish commented Mar 15, 2022

Yes, I think it wasn't available on WebGL1 maybe? But yeah, it's very handy if you don't want interpolation and 0-1 coordinates are not convenient.

@0b5vr
Copy link
Collaborator

0b5vr commented May 23, 2022

After this change, I believe crashes on specific Android devices have been fixed.

Crashes have happened in r138, on devices that have PowerVR GE8320 GPU, and happened when loading geometries with a certain amount of vertices and morphs.

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
…ob#23727)

* WebGLRenderer: Use texelFetch() to sample morph target texture.

* Simplify shader.
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.

5 participants