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
varying highp vec2 oTexCoord; | |
uniform sampler2D Texture0; // rgba | |
uniform sampler2D Texture1; // palette | |
uniform vec2 Texture1_PixelSize; | |
const highp mat3 Transform = mat3( 1,0,0, 0,1,0, 0,0,1 ); | |
const int TransparentPixelIndex = 0; | |
float GetColourScore(vec4 a,vec4 b) | |
{ |
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
float2 texelsize; // 1/width | |
bool isalpha(uv,offset) | |
{ | |
// if bilinear sampling, then you might want to increase this rather than checking for pure 0 | |
return sample( uv + offset*texelsize ).w < 0.1; | |
} | |
float getdistancetoedge(uv,float radius) |
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
Shader "NewChromantics/PaintCloudData" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
PaintUv("PaintUv", VECTOR) = (0,0,0,0) | |
PaintBrushSize("PaintBrushSize", Range(0,0.1) ) = 0.1 | |
} | |
SubShader | |
{ |
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
#include "HwndExtractor.h" | |
#include <future> | |
#include <SoyJson.h> | |
void EnumWindows(ArrayBridge<TWindowHandle>&& Handles,std::function<bool(const std::string&)> Filter) | |
{ | |
// WNDENUMPROC | |
auto EnumWindowsCallback = [](HWND window_handle, LPARAM param) -> BOOL | |
{ |
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
static T[] FindObjectsOfTypeIncludingDisabled<T>() | |
{ | |
var ActiveScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene (); | |
var RootObjects = ActiveScene.GetRootGameObjects (); | |
var MatchObjects = new List<T> (); | |
foreach (var ro in RootObjects) { | |
var Matches = ro.GetComponentsInChildren<T> (true); | |
MatchObjects.AddRange (Matches); | |
} |
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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.IO; | |
/// <summary> | |
/// General utilities | |
/// </summary> | |
public static class PopCloud | |
{ |
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
// Each #kernel tells which function to compile; you can have many kernels | |
#pragma kernel ParsePositionColour | |
// Create a RenderTexture with enableRandomWrite flag and set it | |
// with cs.SetTexture | |
//RWTexture2D<float4> Result; | |
struct XyzRgba | |
{ | |
float x; |
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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.Diagnostics; | |
using System.IO; | |
using System; | |
// stolen from https://github.com/keijiro/FFmpegOut/blob/master/Assets/FFmpegOut/FFmpegPipe.cs | |
// then gave up and wrote from scratch |
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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
//using System.Diagnostics; | |
using System.IO; | |
using System; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif |
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
// use this shader https://github.com/SoylentGraham/PopUnityCommon/blob/master/BlitCubemapToEquirect.shader | |
// and utils in here https://github.com/SoylentGraham/PopUnityCommon/blob/master/PopTexture.cs | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CameraRecorder : MonoBehaviour { | |
public Cubemap RenderTargetCubemap; | |
public RenderTexture RenderTargetEquirect; |
OlderNewer