ScriptReference/Texture2D.GetPixelBilinear #215
Replies: 1 comment
-
|
At first glance from the code sample alone you may assume that pixel XY to texel UV would be achieved by by normalizing to 0-1 range: float u = x / (texture.width - 1);
float v = x / (texture.height - 1);However as the documentation above says this is not correct, you should instead normalize to one pixel less, as a UV of 1 is would be the same as 0 in repeat filter mode, so instead the conversion should be: float u = x / texture.width;
float v = x / texture.height; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/Texture2D.GetPixelBilinear
https://docs.unity3d.com/ScriptReference/Texture2D.GetPixelBilinear.html
Beta Was this translation helpful? Give feedback.
All reactions