Klimczak.Jan Posted July 1, 2019 Share Posted July 1, 2019 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
silent Posted July 2, 2019 Share Posted July 2, 2019 Hi Jan, What do you mean by "not work well for background channel"? Could you please send us a minimal test with reproduction where we can see what is going on? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Klimczak.Jan Posted July 2, 2019 Author Share Posted July 2, 2019 (edited) 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 Edited July 2, 2019 by Klimczak.Jan Link to comment
silent Posted July 2, 2019 Share Posted July 2, 2019 I can see the difference on your screenshots, however I can't say right now what is causing this. Could you please also provide a minimal test code that generates all these images? It will help us to identify the root cause of this behavior faster. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Klimczak.Jan Posted July 3, 2019 Author Share Posted July 3, 2019 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
silent Posted July 3, 2019 Share Posted July 3, 2019 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Klimczak.Jan Posted July 3, 2019 Author Share Posted July 3, 2019 Thank you @silent, I will try do it :) Link to comment
Recommended Posts