Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing gif #9

Closed
yosun opened this issue Jul 10, 2017 · 2 comments
Closed

Resizing gif #9

yosun opened this issue Jul 10, 2017 · 2 comments

Comments

@yosun
Copy link

yosun commented Jul 10, 2017

Hello! It seems that there are some threading complications where bilinear scaling seems to only work on the first frame (by resizing each texture2d right before it’s added to the gif structure)

Do you have suggestions on resizing the gif?

@yosun
Copy link
Author

yosun commented Jul 13, 2017

Recorder.cs - http://wiki.unity3d.com/index.php/TextureScale

			// Process the frame queue
			while (m_Frames.Count > 0)
			{
				RenderTexture source = m_Frames.Dequeue ();
				Texture2D target = temp;
				RenderTexture.active = source;
				target.ReadPixels(new Rect(0, 0, source.width, source.height), 0, 0);
				target.Apply();
				RenderTexture.active = null;
				//TextureScale.Bilinear (target, adjWidth,adjHeight);
				//yield return new WaitForSeconds (0.05f);
				GifFrame frame = ToGifFrame(target);
				frames.Add(frame);
				yield return null;
			}

@yosun
Copy link
Author

yosun commented Jul 13, 2017

mea culpa! target.Resize() at the end solved it

@yosun yosun closed this as completed Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant