- Home /
GetPixelBilinear returning different value between unity versions for Compressed texture
Previous Unity ver: 2019.1.9f1 Updated unity ver: 2019.2.6f1
I have a texture with Mitchcell resize algorithm, automatic format, and normal quality. In both versions the automatic format is the same: DXT1 graphicsFromat: RGBA_DXT1_UNorm
Texture type: Default
Texture shape:2D
sRGB (Color Texture) is true
Alpha Source: Input Texture Alpha
Alpha is Transparency: false
Remove Matte (PSD): True
Read/Write Enabled: True
Generate MipMaps: false
Wrap Mode: Repeat
Filter Mode: Bilinear
When calling GetPixelBilinear on the texture with same uv I get 1 for v2019.1.9f1 and I get 0.9882353 for v 2019.2.6f1. These values are taken from the red channel of the result.
If I set the textures to uncompressed then they both return a 3rd value of: 0.9960784.
Why would the version difference cause this? I would expect that the same compression format to give identical results. Also, I can't detect any setting differences between the two. Anyone have any ideas why this would occur?
Answer by BRW_arjan · Oct 04, 2019 at 09:58 AM
compression is neither lossless, nor predictable. Unity has probably optimized the compression algorithm. Don't depend on pixel values when they are compressed lossy.
Your answer
![](https://koobas.hobune.stream/wayback/20220612212947im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Texture coordinate sampling in cg surface shader 1 Answer
Neighbored terrains splatmap texture seams are shifted 0 Answers
Pixel perfect sampling in surface shader 1 Answer
Why does tex3d return a different value than tex2d? 2 Answers
Create Texture2D and assign image to it through a script 1 Answer