Generates an algorithmic 3D OBJ file with ThreeJS and Node.js.
# print to stdout
node generate-mesh.js > test.obj
# write to file
node generate-mesh.js test.obj
(function () { | |
var scriptName = "embed.js"; //name of this script, used to get reference to own tag | |
var jQuery; //noconflict reference to jquery | |
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; | |
var jqueryVersion = "1.8.3"; | |
var scriptTag; //reference to the html script tag | |
/******** Get reference to self (scriptTag) *********/ | |
var allScripts = document.getElementsByTagName('script'); |
Shader "Sprites/Cutout" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 | |
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.5 | |
} |
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
Shader "Mattatz/SobelFilter" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_DeltaX ("Delta X", Float) = 0.01 | |
_DeltaY ("Delta Y", Float) = 0.01 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } |
// An outline shader made for Unity with the help of @OverlandGame by @miichidk | |
// It adjusts the size of the outline to automatically accomodate screen width and camera distance. | |
// See how it looks here: https://twitter.com/OverlandGame/status/791035637583388672 | |
// How to use: Create a material which uses this shader, and apply this material to any meshrenderer as second material. | |
Shader "OutlineShader" | |
{ | |
Properties | |
{ | |
_Width ("Width", Float ) = 1 | |
_Color ("Color", Color) = (1,1,1,1) |
alias weather='curl -s wttr.in | sed -n "1,7p"' |
using Client.Game.Managers; | |
using Client.Game.Utils; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.PostProcessing; | |
namespace Client.Game.Cameras | |
{ | |
public class PostProcessingController | |
{ |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { | |
if (p < 0.5) | |
return 0.5 * pow(2*p, g); |
Texture2D[] layers; | |
Texture2D compiledTexture = new Texture2D(layers[0].width, layers[0].height); | |
foreach(Texture2D layer in layers){ | |
Color[] baseColors = compiledTexture.GetPixels(); | |
Color[] layerColors = layer.GetPixels(); | |
for(int p = 0; p < baseColors.Length; p++){ |