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
// in our case, | |
const float kRGBMMaxRange = 8.0f; | |
const float kOneOverRGBMMaxRange = 1.0f / kRGBMMaxRange; | |
// encode to RGBM, c = ARGB colors in 0..1 floats | |
float r = c[1] * kOneOverRGBMMaxRange; | |
float g = c[2] * kOneOverRGBMMaxRange; | |
float b = c[3] * kOneOverRGBMMaxRange; |
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
/// <summary> | |
/// Encapsulates a zeroMQ context and a worker thread. | |
/// Use the ZmqPollPool to server multiple 0mq sockets with single-threaded semantics. | |
/// | |
/// Use MarshalAndWait or MarshalAsync to marshal 0mq context access to the working thread. | |
/// Call Dispose to close all registered sockets and terminate the context and thread. | |
/// </summary> | |
public class ZmqPollPool : IDisposable | |
{ | |
private TimeSpan _pollTimeout; |
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
multi_compile A B C | |
multi_compile D E | |
A B C D E | |
+ . . + . | |
. + . + . | |
. . + + . | |
+ . . . + | |
. + . . + | |
. . + . + |
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 UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class ShuffleBag<T> : ICollection<T>, IList<T> | |
{ | |
private List<T> data = new List<T> (); | |
private int cursor = 0; | |
private T last; | |
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
# ##### BEGIN GPL LICENSE BLOCK ##### | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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 UnityEngine; | |
using System.Collections; | |
/// <summary> | |
/// Utility class for working with planes relative to a camera. | |
/// </summary> | |
public static class CameraPlane | |
{ | |
/// <summary> | |
/// Returns world space position at a given viewport coordinate for a given depth. |
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 UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
/* Google Analytics integration. Web page must be configured for GA with Google's javascript snippet. | |
* | |
* Based on a comment from 2010 found here: | |
* http://blog.mostlytigerproof.com/2009/10/06/gathering-statistics-using-google-analytics-and-unity-3d/ | |
* | |
* Analytics category/action/label/value descriptions: |
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
public sealed class Host | |
{ | |
private readonly string _zmqEndpoint; | |
private readonly Action<Action> _dispatcher; | |
private static ZmqSocket _server; | |
private static readonly ConcurrentQueue<Action> WaitToSend = new ConcurrentQueue<Action>(); | |
public Host(string zmqEndpoint, Action<Action> dispatcher) | |
{ | |
_zmqEndpoint = zmqEndpoint; |
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
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
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
# Installation | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
# Easy Peasy | |
ffmpeg -i video.mp4 video.webm |
OlderNewer