-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Closed
Labels
Milestone
Description
Description
It appears it's not currently possible to create a varying with TSL with a interpolation type qualifier, for example in GLSL, centroid.
centroid varying vec2 uvCentroid
In three.js WebGLRenderer projects I have used centroid to work around issues with texture bleeding when using texture atlases with MSAA.
Solution
Consider exposing common interpolation qualifiers via TSL.
I don't have good concrete API suggestions, but here's a simple example of how I'd use this:
const uvCentroid = uv().interpolation("centroid")
const color = texture(map, uvCentroid)
Alternatives
Some other general API for exposing common qualifiers.
Additional context
GLSL: Center or Centroid? (Or When Shaders Attack!) - https://opengl.org/pipeline/article/vol003_6
https://www.w3.org/TR/WGSL/#interpolation-sampling-centroid