This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UIElements; | |
using UnityEngine.EventSystems; | |
using UnityEngine.Rendering; | |
namespace Katas.Experimental | |
{ | |
public class WorldSpaceUIDocument : MonoBehaviour, IPointerMoveHandler, IPointerUpHandler, IPointerDownHandler, | |
ISubmitHandler, ICancelHandler, IMoveHandler, IScrollHandler, ISelectHandler, IDeselectHandler, IDragHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
half3 Hue2RGB(half h) | |
{ | |
h = frac(saturate(h)) * 6 - 2; | |
half3 rgb = saturate(half3(abs(h - 1) - 1, 2 - abs(h), 2 - abs(h - 2))); | |
#ifndef UNITY_COLORSPACE_GAMMA | |
rgb = GammaToLinearSpace(rgb); | |
#endif | |
return rgb; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Trim from 2″ for 3 seconds, and encode into a "Twitter friendly" format. | |
ffmpeg -i source.mp4 -pix_fmt yuv420p -an -ss 2 -t 3 temp.mp4 | |
:: Make a palette for GIF. | |
ffmpeg -i temp.mp4 -vf palettegen=max_colors=24 palette.png | |
:: Make a GIF with the palette. | |
ffmpeg -i temp.mp4 -i palette.png -filter_complex "scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse" -r 30 out.gif |