Jump to content

[SOLVED] Screenshot with transparency


photo

Recommended Posts

d.vavilov

You need just to grab and RGBA image (Environment rendering should be enabled). In A channel there would be an alpha that will mask the background. Please check the attached RGBA picture - it has been grabbed with built-in Video Grabber tool from inside the Editor.

Thanks!

frame_5.zip

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

Link to comment

But how to do it in runtime?

var ima = new Image();
Render.GetScreenshot(ima);
ima.Save(AppDomain.CurrentDomain.BaseDirectory+"test.tga");

this code brings screenshot with background (haze), but same scene with Tracker and Video grabber gives screenshot without it

image.thumb.png.f38ca13bd8369f0d88aacca1c7d2f775.png

Link to comment
  • 1 month later...

Is it possible to get a small reproduction project that we can run and test?

If you can emulate your web camera image rendering - it would be just great. Maybe there is something different happens when additional texture is being rendered on top.

Thanks!

 

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

Link to comment

I've tried to fix this two shady lines of code:

if (image.Format == Image.FORMAT_RGBA8)
	image.ConvertToFormat(Image.FORMAT_RGB8); // needs to be RGBA8 to keep the alpha instead of sky color

Also, RGBA16F can't be saved into PNG, use DDS / EXR formats instead.

After replacing RGB8 with RGBA8, I have correct results with transparent sky (check attached image).

Thanks!

prozr.png

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

Link to comment
  • silent changed the title to [SOLVED] Screenshot with transparency
×
×
  • Create New...