BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: BT81X Bilinear filtering make dark border on bitmaps  (Read 103 times)

ddv2005

  • Newbie
  • *
  • Posts: 5
    • View Profile
BT81X Bilinear filtering make dark border on bitmaps
« on: February 19, 2021, 08:02:15 AM »

Hello,

I have found that each bitmap in bilinear filtering mode has dark border. On attached picture left image rendered in NEAREST filtering mode and no dark borders. Right image the same but in BILINEAR mode and you can see grey border.
As I understand BT81X just mix black color at the edges that absolutely weird and unacceptable.
Is it any way to do not mix black color at edges in bilinear filtering mode?
Logged

BRT Community

  • Administrator
  • Sr. Member
  • *****
  • Posts: 307
    • View Profile
Re: BT81X Bilinear filtering make dark border on bitmaps
« Reply #1 on: February 19, 2021, 04:10:48 PM »

Hello,

Thank you for your question.
Could you give me details on how you have converted the bitmaps you are using with Bilinear filtering, so I can investigate this issue further?

Best Regards,
BRT Community
Logged

ddv2005

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: BT81X Bilinear filtering make dark border on bitmaps
« Reply #2 on: February 19, 2021, 04:26:27 PM »

Hello,

Images converted by EAB tool from png to ASTC 4x4/8x8 without any scale.  Bilinear filtering is used to scale and render the image by BT81X. This is my test code to render image form Screen Editor:

Code: [Select]
CMD_SETBITMAP(0, COMPRESSED_RGBA_ASTC_4x4_KHR, 240, 240)
BITMAP_SIZE(BILINEAR, BORDER, BORDER, 240, 240)
CMD_LOADIDENTITY()
CMD_SCALE(196608, 196608)
CMD_TRANSLATE(1769472, 0)
CMD_SETMATRIX()
BEGIN(BITMAPS)
VERTEX2II(40, 0, 0, 0)


Also I make a test project in Screen Editor to reproduce the issue. White square PNG 64x64 loaded at 0 address and displayed by code:
Code: [Select]
CLEAR_COLOR_RGB(255,0, 0)
CLEAR(1, 1, 1)
CMD_SETBITMAP(0, COMPRESSED_RGBA_ASTC_4x4_KHR, 64, 64)
BITMAP_SIZE(NEAREST, BORDER, BORDER, 240, 240)
CMD_LOADIDENTITY()
CMD_SCALE(196608, 196608)
CMD_TRANSLATE(196608, 131072)
CMD_SETMATRIX()
BEGIN(BITMAPS)
VERTEX2II(40, 0, 0, 0)

In NEAREST mode everything good (see first attachment). But in BILINEAR mode you can see dark borders around white box (second attachment)
« Last Edit: February 19, 2021, 04:40:11 PM by ddv2005 »
Logged

ddv2005

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: BT81X Bilinear filtering make dark border on bitmaps
« Reply #3 on: February 19, 2021, 06:00:43 PM »

I found some workaround for my case: expand tiles by 1 pixel in each side (to make tiles overlap by 1 pixel) and then cut blended BILINEAR dark borders by ALPHA_FUNC(GEQUAL, 248). Now it looks much better.
bf_new_cut.jpg is final image and bf_new_no_cut.jpg is overlapped images but no ALPHA_FUNC to cut borders.
« Last Edit: February 19, 2021, 06:35:39 PM by ddv2005 »
Logged

BRT Community

  • Administrator
  • Sr. Member
  • *****
  • Posts: 307
    • View Profile
Re: BT81X Bilinear filtering make dark border on bitmaps
« Reply #4 on: February 22, 2021, 04:30:12 PM »

Hello,

Thank you for the details.
I'm glad you work around is producing much better results currently, I am in discussion with the development team to see if they have any other suggestions for mitigating this behaviour.

Best Regards,
BRT Community
Logged

BRT Community

  • Administrator
  • Sr. Member
  • *****
  • Posts: 307
    • View Profile
Re: BT81X Bilinear filtering make dark border on bitmaps
« Reply #5 on: February 24, 2021, 12:38:09 PM »

Hello,

The developers have noted that every bitmap in BORDER mode has a black border. It's not normally visible, but in bilinear at the edges, the black border pixels get sampled and used. We are looking into modes for future revisions of EVE to mitigate this behaviour, but currently there is the expected behaviour for EVE.

Best Regards,
BRT Community
Logged