Jump to content

How to anti-alias alpha channel for generated screenshot via cpp


photo

Recommended Posts

Hi,

I use multiple viewport->renderImage2D(camera, screenshot_image); method in update to anti alias an image. But this not work/ or not work well for background channel.

How can I anti alias whole image including alpha channel ? How can I anti alias alpha channel ? What you can suggest to get the best result ?

ps.

It is possible to get image with 16 bit alpha channel ?

Kind regards,

 

Link to comment

Hi @silent,

I attach 3 screenshots:

frame_0003.png - screenshot without alpha channel 
frame_0004.png - screenshot with alpha channel
frame_0004_bcg.png - is the frame_0004.png with added white background into it

As you can compare frame_0003.png with frame_0004_bcg.png the frame_0003.png looks smoother than frame_0004_bcg.png. I thing that generated alpha channel is not AA enought because there should not be difference in both images ?
 

Thanks,

Jan

frame_0003.png

frame_0004.png

frame_0004_with_bcg.png

Edited by Klimczak.Jan
Link to comment

Hi @silent,

I prepare script for taking screenshot from viewport (as you see there is one frame delay which is not used here - it is for screenshot->copy2D(); before swap - but here it is not used, the result in two modes are pretty the same). I attach it. Please look at it, maybe you will find the solution for it :)

Thanks!
Jan

Issue_alpha_AA.cpp

Link to comment

If that's a code that you are using in your real project I think the easiest way to get a better AA is to simply render an image in a higher resolution and then resize before saving.

If you need to have the final image 1920x1080 you can render in 4K (3840x2160) and then resize. You can experiment with different resolutions to see what really helps.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...