mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
Fix mipmap filtering issues in tinydisplay renderer
This commit is contained in:
parent
2e9394eba7
commit
3f53994372
@ -39,6 +39,7 @@ This issue fixes several bugs that were still found in 1.9.2.
|
||||
* Windows installer no longer clears %PATH% if longer than 1024 chars
|
||||
* Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar
|
||||
* Fix tinydisplay texture errors on shutdown
|
||||
* Fix mipmap filtering issues in tinydisplay renderer
|
||||
|
||||
------------------------ RELEASE 1.9.2 ------------------------
|
||||
|
||||
|
@ -489,11 +489,11 @@ lookup_texture_mipmap_linear(ZTextureDef *texture_def, int s, int t, unsigned in
|
||||
level = max((int)level - 1, 0);
|
||||
p2 = ZB_LOOKUP_TEXTURE_MIPMAP_NEAREST(texture_def, s, t, level);
|
||||
|
||||
unsigned int bitsize = level + ZB_POINT_ST_FRAC_BITS;
|
||||
r = LINEAR_FILTER_BITSIZE(PIXEL_R(p2), PIXEL_R(p1), level_dx, bitsize);
|
||||
g = LINEAR_FILTER_BITSIZE(PIXEL_G(p2), PIXEL_G(p1), level_dx, bitsize);
|
||||
b = LINEAR_FILTER_BITSIZE(PIXEL_B(p2), PIXEL_B(p1), level_dx, bitsize);
|
||||
a = LINEAR_FILTER_BITSIZE(PIXEL_A(p2), PIXEL_A(p1), level_dx, bitsize);
|
||||
unsigned int f = level_dx >> (level - 1);
|
||||
r = LINEAR_FILTER(PIXEL_R(p1), PIXEL_R(p2), f);
|
||||
g = LINEAR_FILTER(PIXEL_G(p1), PIXEL_G(p2), f);
|
||||
b = LINEAR_FILTER(PIXEL_B(p1), PIXEL_B(p2), f);
|
||||
a = LINEAR_FILTER(PIXEL_A(p1), PIXEL_A(p2), f);
|
||||
|
||||
return RGBA_TO_PIXEL(r, g, b, a);
|
||||
}
|
||||
@ -570,11 +570,11 @@ lookup_texture_mipmap_trilinear(ZTextureDef *texture_def, int s, int t, unsigned
|
||||
}
|
||||
|
||||
int r, g, b, a;
|
||||
unsigned int bitsize = level + ZB_POINT_ST_FRAC_BITS;
|
||||
r = LINEAR_FILTER_BITSIZE(PIXEL_R(p2a), PIXEL_R(p1a), level_dx, bitsize);
|
||||
g = LINEAR_FILTER_BITSIZE(PIXEL_G(p2a), PIXEL_G(p1a), level_dx, bitsize);
|
||||
b = LINEAR_FILTER_BITSIZE(PIXEL_B(p2a), PIXEL_B(p1a), level_dx, bitsize);
|
||||
a = LINEAR_FILTER_BITSIZE(PIXEL_A(p2a), PIXEL_A(p1a), level_dx, bitsize);
|
||||
unsigned int f = level_dx >> (level - 1);
|
||||
r = LINEAR_FILTER(PIXEL_R(p1a), PIXEL_R(p2a), f);
|
||||
g = LINEAR_FILTER(PIXEL_G(p1a), PIXEL_G(p2a), f);
|
||||
b = LINEAR_FILTER(PIXEL_B(p1a), PIXEL_B(p2a), f);
|
||||
a = LINEAR_FILTER(PIXEL_A(p1a), PIXEL_A(p2a), f);
|
||||
|
||||
return RGBA_TO_PIXEL(r, g, b, a);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user