Chman / Moments

A quick GIF replay recorder for Unity
zlib License
856 stars 118 forks source link

Recording just part of the screen #8

Open yosun opened 7 years ago

yosun commented 7 years ago

It seems that, due to the usage of RenderTexture.active and having the resultant ReadPixel be "blit'd" from that, it's not possible to record just part of the screen?

I've tried using multiple cameras and changing the pixelRect to be cropped to the right part of the screen.. Is using RenderTexture necessary or is there a work around to this?

Changing the y coordinate of the ReadPixel after the RenderTexture.active source - instead of read pixel from that y coordinate, here is an example of what I mean - https://gyazo.com/5393dd53594368d117370377466cf102

Chman commented 7 years ago

You'll need to modify the source code for that, by default Moments captures the whole camera view. The easiest way would be to do the cropping right after it captured the screen.

yosun commented 7 years ago

it looks like Unity is not able to crop a RenderTexture, so the next best thing is changing the camera pixelRect. I'm not sure where the rendertexture is being rasterized (?)

yosun commented 6 years ago

pokes