diff --git a/Asset.meta b/Asset.meta new file mode 100644 index 0000000..67c4e40 --- /dev/null +++ b/Asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7743f8c52008a9d4aa780f0edf39984e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Asset/Texture.meta b/Asset/Texture.meta new file mode 100644 index 0000000..f5280ee --- /dev/null +++ b/Asset/Texture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88828489e3254af4a8041c7529154569 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..2c6a4e1 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a167bada92a0244ebe7b5e9f05311ba +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources.meta b/Resources.meta new file mode 100644 index 0000000..c63e024 --- /dev/null +++ b/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 495627c0ae63b5741ade9ce06b724256 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_ColoredPencils.meta b/Resources/flockaroo_ColoredPencils.meta new file mode 100644 index 0000000..d8c983f --- /dev/null +++ b/Resources/flockaroo_ColoredPencils.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 942be931e8ebda149a13d3d1523b4102 +folderAsset: yes +timeCreated: 1529632860 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_ColoredPencils/coloredpencil.cginc b/Resources/flockaroo_ColoredPencils/coloredpencil.cginc new file mode 100644 index 0000000..361f50e --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/coloredpencil.cginc @@ -0,0 +1,403 @@ +// created by florian berger (flockaroo) - 2018 + +// color crosshatch effect + +// uncomment this if you have performance problems +//#define NEW_METHOD +//#define FASTER +// try uncommenting this if the effect doesnt work (some platforms dont support many nested loops) +//#define LESS_LOOPS + +//#define __UNITY_3D__ + +#define Res iResolution.xy +#define Res0 vec2(textureSize(iChannel0,0)) +#define Res1 vec2(textureSize(iChannel1,0)) +#define Res2 vec2(textureSize(iChannel2,0)) +#define Res3 vec2(textureSize(iChannel3,0)) + +#define PI2 6.28318530718 +#define sc (iResolution.x/600.) + +#ifndef __UNITY_3D__ +#define mul(a,b) (b*a) +#define vec2i vec2 +#define vec3i vec3 +#define vec4i vec4 +#endif + +#ifdef __UNITY3D__ +sampler2D _PaperTex; +float4 _PaperTex_TexelSize; +#endif + +vec2 roffs; +float ramp; +float rsc; + +vec2 uvSmooth(vec2 uv,vec2 res) +{ + return uv+.6*sin(uv*res*PI2)/PI2/res; +} + +vec4 getRand(vec2 pos) +{ + vec2 tres=vec2(textureSize(iChannel1,0)); + //vec2 fr=fract(pos-.5); + //vec2 uv=(pos-.7*sin(fr*PI2)/PI2)/tres.xy; + vec2 uv=pos/tres.xy; + //uv=uvSmooth(uv,tres); + return textureLod(iChannel1,uv,0.); +} + +#ifdef SHADEROO +uniform float flicker; +uniform float flickerFreq; +uniform float brightness; +uniform float contrast; +uniform float contentWhiteVign; +uniform float hatchLen; +#else +float flicker=0.; +#endif + +//int flickerTime = 5; + +//#define flickerParam (float(iFrame/5)/60.*flicker) +float flickerParam; + +vec4 getCol2(vec2 pos) +{ + vec2 res = vec2(textureSize(iChannel2,0)); + vec2 uv=(pos-iResolution.xy*.5)*vec2(res.y,res.x)/mix(iResolution.x*res.y,iResolution.y*res.x,.5); + vec4 c = texture(iChannel2,uv+.5); + return c; +} + +vec4 getCol(vec2 pos, float lod) +{ + vec4 r1 = (getRand((pos+roffs)*.05*rsc/sc+131.*flickerParam+13.)-.5)*10.*ramp; + vec2 res0=vec2(textureSize(iChannel0,0)); + vec2 uv=(pos+r1.xy*sc)/iResolution.xy; + //uv=uvSmooth(uv,res0); + vec4 c = textureLod(iChannel0,uv,lod); + c = clamp(((c-.5)*contrast+.5)*brightness,0.,100.); + vec4 bg= vec4i(vec3i(clamp(.3+pow(length(uv-.5),2.),0.,1.)),1); + bg=vec4i(1); + //c*=vec4(1.2,1,.8,1); + //c = mix(c,bg,clamp(dot(c.xyz,vec3(-1,1.8,-1)*1.5),0.,1.)); + float vign=pow(clamp(-.5+length(uv-.5)*contentWhiteVign*3.,0.,1.),3.); + c = mix(c,bg,vign); + //c=(c*1.3-.5)*.7+.5; + return c; +} + +vec4 getCol(vec2 pos) +{ + return getCol(pos,0.); +} + +vec3 quant(vec3 c, ivec3 num) +{ + vec3 fnum=vec3(num); + return floor(c*(fnum-.0001))/(fnum-1.); +} + +float quant(float c, int num) +{ + float fnum=float(num); + return floor(c*(fnum-.0001))/(fnum-1.); +} + +float squant(float c, int num, float w) +{ + float fnum=float(num); + float s=sin(c*fnum*PI2); + c*=fnum; + c=mix(floor(c),ceil(c),smoothstep(-w*.5,w*.5,c-floor(c)-.5)); + return c/fnum; +} + +float getVal(vec2 pos) +{ + return clamp(dot(getCol(pos).xyz,vec3i(.333)),0.,1.); +} + +float getVal(vec2 pos,float lod) +{ + return clamp(dot(getCol(pos,lod).xyz,vec3i(.333)),0.,1.); +} + +float compAbsMax(vec3 v) { vec3 a=abs(v); return (a.x>a.y) ? (a.x>a.z)?v.x:v.z : (a.y>a.z)?v.y:v.z; } + +vec2 getMaxGrad(vec2 pos, float eps, float lod) +{ + vec2 d=vec2(eps,0); + vec3 c0=getCol(pos,lod).xyz; + return vec2( + compAbsMax(getCol(pos+d.xy,lod).xyz-c0), + compAbsMax(getCol(pos+d.yx,lod).xyz-c0) + )/eps; +} + +vec2 getMaxGrad(vec2 pos, float eps) +{ + return getMaxGrad(pos, eps, 0.); +} + +vec2 getGrad(vec2 pos, float eps, float lod) +{ + vec2 d=vec2(eps,0); + float v0=getVal(pos,lod); + return vec2( + getVal(pos+d.xy,lod)-v0, + getVal(pos+d.yx,lod)-v0 + )/eps; +} + +vec2 getGrad(vec2 pos, float eps) +{ + return getGrad(pos, eps, 0.); +} + +float compProd(vec2 v) +{ + return v.x*v.y; +} + +#ifdef SHADEROO +uniform float fixedHatchDir; +uniform float outlines; +uniform float hatches; +uniform float vignetting; +uniform float hatchScale; +uniform vec3 paperTint; +uniform float paperRough; +uniform float paperTexFade; +uniform float colorStrength; +uniform float effectFade; +uniform float panFade; +uniform float mipLevel; +uniform float outlineRand; +#else +float brightness=1.; +float fixedHatchDir=0.; +float outlines=1.; +float vignetting=1.; +float hatchScale=1.; +vec3 paperTint = vec3(1,.97,.85); +#endif + + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + flickerParam = ((iTime-mod(iTime,1.0/max(flickerFreq,1.)))*flicker); + + float issc=1./sqrt(sc); + vec4 r = getRand(fragCoord*1.2*issc)-getRand(fragCoord*1.2*issc+vec2(1,-1)*1.5); + vec4 r2 = getRand(fragCoord*1.2*issc); + + // outlines + float br=0.; + roffs = vec2i(0.); + ramp = .7*outlineRand; + rsc = .7; +#ifdef FASTER + int num=1; +#else + int num=3; +#endif + for(int i=0;i0.5) paperCol *= texture(_PaperTex,fragCoord/iResolution.xy).xyz; + fragColor.xyz=paperCol-contour; + fragColor.xyz=clamp(fragColor.xyz,0.,1.); + + + // cross hatch + ramp=0.; +#ifdef FASTER + int hnum=2; +#else + int hnum=3; +#endif + #define N(v) (v.yx*vec2(-1,1)) + #define CS(ang) cos(ang-vec2(0,1.6)) + #ifdef NEW_METHOD + vec3 hatch = vec3i(0); + + for(float i=0.;i 1,0,0 k=1 -> 0,1,0 k=2 -> 0,0,1 + vec3 comp = 1.-clamp(vec3(ivec3(k,k+2,k+1)%3),0.,1.); + comp /= comp.x+comp.y+comp.z; + comp = mix(vec3i(.33),comp,colorStrength); +#ifdef LESS_LOOPS + for(int i2=0;i2 Cg +// many things can be covered here, but... +// not possible by typedef or #define are: +// (at least not with the limited preprocess abilities of Cg) +// +// array initializers +// glsl: type arr[n] = type[](a,b,c,...); +// Cg: type arr[n] = {a,b,c,...} +// +// vec initializers with 1 arg: +// glsl: vec4(x) +// Cg: vec4i(x) (see helpers below - or float4(x,x,x,x)) +// +// matrix multiplications +// glsl: m*v +// Cg: mul(m,v) +// +// matrix initializers (column first in glsl) +// glsl: mat4(a,b,c,...) +// Cg: transpose(mat4(a,b,c,...)) +// +// in mainGeom(...) vertAttrib[] not initialized +// so either inout as argument, or actually init them in mainGeom() +// + +float4 vec4i(float x) { return float4(x,x,x,x); } +float4 vec4i(float x, float3 v) { return float4(x,v.x,v.y,v.z); } +float4 vec4i(float3 v, float x) { return float4(v.x,v.y,v.z,x); } +float4 vec4i(float2 v1, float2 v2) { return float4(v1.x,v1.y,v2.x,v2.y); } +float3 vec3i(float x) { return float3(x,x,x); } +float3 vec3i(float2 v, float x) { return float3(v.x,v.y,x); } +float3 vec3i(float x, float2 v) { return float3(x,v.x,v.y); } +float2 vec2i(float x) { return float2(x,x); } + +typedef float2 vec2; +typedef float3 vec3; +typedef float4 vec4; +typedef int4 ivec4; +typedef int3 ivec3; +typedef int2 ivec2; +typedef float4x4 mat4; +typedef float3x3 mat3; +typedef float2x2 mat2; + +#define atan(a,b) atan2(a,b) +#define texture(a,b) tex2D(a,b) +//#define texture(a,b,c) tex2Dbias(a,float4(b,0,c)) +#define textureLod(a,b,c) tex2Dlod(a,float4(b,0,c)) +//#define textureLod(a,b,c) tex2D(a,b) +//#define texelFetch(a,b,c) tex2Dfetch(a,int4(b,0,c)) +#define texelFetch(a,b,c) tex2Dlod(a,float4((float2(b)+.5)/float2(textureSize(a,0)),0,c)) + +//#define GET_VARARG_MACRO(_1,_2,_3,_4,NAME,...) NAME +//#define vec4(...) GET_VARARG_MACRO(__VA_ARGS__, vec4i, vec4i, vec4i, vec4i, vec4)(__VA_ARGS__) +//#define vec4 float4 +//#define vec3 float3 +//#define vec2 float2 +//#define ivec4 int4 +//#define ivec3 int3 +//#define ivec2 int2 +//#define mat4 float4x4 +//#define mat3 float3x3 +//#define mat2 float2x2 + +#define mix(a,b,c) lerp(a,b,c) + +#define fract(a) frac(a) +#define mod(a,b) fmod(a,b) + +#define textureSize(a,b) a##_TexelSize.zw + +//#define smoothstep(a,b,c) step(.5*(a+b),c) diff --git a/Resources/flockaroo_ColoredPencils/glsl2Cg.cginc.meta b/Resources/flockaroo_ColoredPencils/glsl2Cg.cginc.meta new file mode 100644 index 0000000..886f5c6 --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/glsl2Cg.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9011d1d15b095d640bf2eb3c1a649cb5 +timeCreated: 1529632977 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_ColoredPencils/imageEffShader.shader b/Resources/flockaroo_ColoredPencils/imageEffShader.shader new file mode 100644 index 0000000..c18ca6a --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/imageEffShader.shader @@ -0,0 +1,100 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/ColoredPencilsShader" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + _MainTexMip ("Texture", 2D) = "white" {} + _RandTex("Texture", 2D) = "white" {} + } + SubShader + { + // No culling or depth + Cull Off ZWrite Off ZTest Always + //Blend One One + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + sampler2D _MainTex; + sampler2D _RandTex; + float4 _RandTex_TexelSize; + float4 _MainTex_TexelSize; + int _FrameCount; + float flipY; + + #define iChannel0 _MainTex + #define iChannel1 _RandTex + #define iChannel2 _MainTex + + #include "glsl2Cg.cginc" + #include "shaderoo.cginc" + #define SHADEROO + #define __UNITY_3D__ + #include "coloredpencil.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + //float4 vertex : TEXCOORD4; + #ifdef SHADEROO_GEOM + float4 vertAttr0: TEXCOORD1; + float4 vertAttr1: TEXCOORD2; + float4 vertAttr2: TEXCOORD3; + #endif + }; + + v2f vert (appdata v) + { + v2f o; + #ifdef SHADEROO_GEOM + float4 vertAttr[3] = { float4(0,0,0,0), float4(0,0,0,0), float4(0,0,0,0) }; + /*vertAttr[0]=float4(0,0,0,0); + vertAttr[1]=float4(0,0,0,0); + vertAttr[2]=float4(0,0,0,0);*/ + int vIdx=int(v.vertex.x+.1); + mainGeom(o.vertex,vertAttr,vIdx); + o.vertAttr0=vertAttr[0]; + o.vertAttr1=vertAttr[1]; + o.vertAttr2=vertAttr[2]; + #else + //o.vertex = UnityObjectToClipPos(float4(v.vertex.xyz, 1.0)); + o.vertex = v.vertex; + o.vertex.xy=o.vertex.xy*2.-1.; + o.uv = v.uv; + #endif + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float4 c; + #ifdef SHADEROO_GEOM + float4 vertAttr[3]; + vertAttr[0]=i.vertAttr0; + vertAttr[1]=i.vertAttr1; + vertAttr[2]=i.vertAttr2; + mainFragment(c,i.vertex+vec4(.5,.5,0,0),vertAttr); + //mainFragment(c,vec4((i.vertex.xy*.5+.5)*iResolution.xy,i.vertex.zw),vertAttr); + #else + if(flipY>.5) i.uv.y=1.-i.uv.y; + mainImage(c,i.uv*iResolution.xy); + #endif + return c; + } + ENDCG + } + } +} diff --git a/Resources/flockaroo_ColoredPencils/imageEffShader.shader.meta b/Resources/flockaroo_ColoredPencils/imageEffShader.shader.meta new file mode 100644 index 0000000..306226b --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/imageEffShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 14e857cc01ec926439bfe9c1164b92c9 +timeCreated: 1529632977 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_ColoredPencils/imageEffShader1.shader b/Resources/flockaroo_ColoredPencils/imageEffShader1.shader new file mode 100644 index 0000000..9377372 --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/imageEffShader1.shader @@ -0,0 +1,101 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/ColoredPencilsShader" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + _MainTexMip ("Texture", 2D) = "white" {} + _RandTex("Texture", 2D) = "white" {} + } + SubShader + { + // No culling or depth + Cull Off ZWrite Off ZTest Always + //Blend One One + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + sampler2D _MainTex; + sampler2D _RandTex; + float4 _RandTex_TexelSize; + float4 _MainTex_TexelSize; + int _FrameCount; + float flipY; + + #define iChannel0 _MainTex + #define iChannel1 _RandTex + #define iChannel2 _MainTex + + #include "glsl2Cg.cginc" + #include "shaderoo.cginc" + #define SHADEROO + #define __UNITY_3D__ + #define NEW_METHOD + #include "coloredpencil.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + //float4 vertex : TEXCOORD4; + #ifdef SHADEROO_GEOM + float4 vertAttr0: TEXCOORD1; + float4 vertAttr1: TEXCOORD2; + float4 vertAttr2: TEXCOORD3; + #endif + }; + + v2f vert (appdata v) + { + v2f o; + #ifdef SHADEROO_GEOM + float4 vertAttr[3] = { float4(0,0,0,0), float4(0,0,0,0), float4(0,0,0,0) }; + /*vertAttr[0]=float4(0,0,0,0); + vertAttr[1]=float4(0,0,0,0); + vertAttr[2]=float4(0,0,0,0);*/ + int vIdx=int(v.vertex.x+.1); + mainGeom(o.vertex,vertAttr,vIdx); + o.vertAttr0=vertAttr[0]; + o.vertAttr1=vertAttr[1]; + o.vertAttr2=vertAttr[2]; + #else + //o.vertex = UnityObjectToClipPos(float4(v.vertex.xyz, 1.0)); + o.vertex = v.vertex; + o.vertex.xy=o.vertex.xy*2.-1.; + o.uv = v.uv; + #endif + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float4 c; + #ifdef SHADEROO_GEOM + float4 vertAttr[3]; + vertAttr[0]=i.vertAttr0; + vertAttr[1]=i.vertAttr1; + vertAttr[2]=i.vertAttr2; + mainFragment(c,i.vertex+vec4(.5,.5,0,0),vertAttr); + //mainFragment(c,vec4((i.vertex.xy*.5+.5)*iResolution.xy,i.vertex.zw),vertAttr); + #else + if(flipY>.5) i.uv.y=1.-i.uv.y; + mainImage(c,i.uv*iResolution.xy); + #endif + return c; + } + ENDCG + } + } +} diff --git a/Resources/flockaroo_ColoredPencils/imageEffShader1.shader.meta b/Resources/flockaroo_ColoredPencils/imageEffShader1.shader.meta new file mode 100644 index 0000000..cd9269c --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/imageEffShader1.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 083e1e9d1258029439d28e0ee0c26252 +timeCreated: 1546809258 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_ColoredPencils/shaderoo.cginc b/Resources/flockaroo_ColoredPencils/shaderoo.cginc new file mode 100644 index 0000000..7f75fad --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/shaderoo.cginc @@ -0,0 +1,5 @@ +#define iTime (_Time.y) +#define iMouse float4(0,0,0,0) +#define iResolution float3(_ScreenParams.xy,0) +#define iFrame _FrameCount +#define iMouseData float4(0,0,0,0) diff --git a/Resources/flockaroo_ColoredPencils/shaderoo.cginc.meta b/Resources/flockaroo_ColoredPencils/shaderoo.cginc.meta new file mode 100644 index 0000000..e6ffdad --- /dev/null +++ b/Resources/flockaroo_ColoredPencils/shaderoo.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9806aa3db21a1724189db8ba7edd10b3 +timeCreated: 1529632977 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting.meta b/Resources/flockaroo_OilPainting.meta new file mode 100644 index 0000000..ca9bdcd --- /dev/null +++ b/Resources/flockaroo_OilPainting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72388c02446634bf5b1f88a67609fe9e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/Buff_A.cginc b/Resources/flockaroo_OilPainting/Buff_A.cginc new file mode 100644 index 0000000..8c67237 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Buff_A.cginc @@ -0,0 +1,87 @@ +// created by florian berger (flockaroo) - 2018 +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + +// oil paint brush drawing + +// generating stroke texture + +#define MULTI_STROKE + +#define Res (iResolution.xy) +#define Res0 vec2(textureSize(iChannel0,0)) +#define Res1 vec2(textureSize(iChannel1,0)) +#define Res2 vec2(textureSize(iChannel2,0)) + +#define PI 3.1415927 + +#define N(v) (v.yx*vec2(1,-1)) + +uniform float StrokeBend; +uniform float StrokeContour; +uniform float StrokeDir; + +vec4 getRand(int idx) +{ + ivec2 rres=textureSize(iChannel1,0); + idx=idx%(rres.x*rres.y); + return texelFetch(iChannel1,ivec2(idx%rres.x,idx/rres.x),0); +} + +float getStroke(vec2 uv, int pidx) +{ + vec4 rnd = getRand(pidx); + uv-=.5; + uv.x-=.035*StrokeBend*1.; + uv.x+=uv.y*uv.y*StrokeBend*1.; + //uv.x*=1.+.25*abs(StrokeBend); + uv.x*=1.2; + uv.y+=-StrokeBend*.1*(uv.x)+.05+.01*sin(uv.x*24.+float(pidx)*3.); + uv+=.5; + uv=clamp(uv,0.,1.); + float s=1.; + s*=uv.x*(1.-uv.x)*6.; + s*=uv.y*(1.-uv.y)*6.; + float s0=s; + s=(s-.5); + vec2 uv0=uv; + + // move noise coord for each brush stroke + uv+=rnd.z*vec2(7,5)*303.72; + + // brush hair noise + float psc=1.; + float pat = textureLod(iChannel1,psc*uv*1.5*sqrt(Res.x/600.)*vec2(.06,.006),.5).x + +textureLod(iChannel1,psc*uv*3.0*sqrt(Res.x/600.)*vec2(.06,.006),.5).x; + + s0=s; + uv0.y=1.-uv0.y; + + //s=(14.*(1.-uv0.y)*s0)*(exp(-s0*3.5))-uv0.y*.5; + s=(14.*(1.-uv0.y)*s0)*(exp(-s0*3.5/(StrokeContour+.01))-uv0.y*.5)-uv0.y*.5; + + s=max(s,(pow(abs(s0),.2)*((s0>0.0)?1.:-1.)+(pat-1.4)-uv0.y*1.)*1.); + //s=mix((s0*1.+pat-1.)*1.,s,StrokeContour); + + return s; +} + +uniform int strokeSeed; +#ifdef MULTI_STROKE +uniform vec2 strokeNumXY; +#endif + +void mainImage( out vec4 fragColor, vec2 fragCoord ) +{ + int seed=strokeSeed; + vec2 uv = fragCoord.xy / Res2; + #ifdef MULTI_STROKE + vec2 xynum=floor(max(vec2i(strokeNumXY),vec2i(1))); + vec2 uv2 = fract(uv*xynum); + vec2 xy = floor(uv*xynum); + uv=uv2; + seed+=7*int(xy.y*xynum.x+xy.x); + #endif + fragColor.xyz =vec3i(0) + getStroke(uv,seed); + fragColor.w = 1.; +} + diff --git a/Resources/flockaroo_OilPainting/Buff_A.cginc.meta b/Resources/flockaroo_OilPainting/Buff_A.cginc.meta new file mode 100644 index 0000000..fecfe0c --- /dev/null +++ b/Resources/flockaroo_OilPainting/Buff_A.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d539d1b2b118948ae9062c680b7a72d9 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/Buff_A.shader b/Resources/flockaroo_OilPainting/Buff_A.shader new file mode 100644 index 0000000..630ee9e --- /dev/null +++ b/Resources/flockaroo_OilPainting/Buff_A.shader @@ -0,0 +1,119 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Buff_AShader" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + //_MainTexMip ("Texture", 2D) = "white" {} + //_RandTex("Texture", 2D) = "white" {} + + //_FrameCount("framecount", Int) = 0; + //flipY("Flip Y", Float) = 0.; + + //###ShaderUniforms + } + SubShader + { + // No culling or depth + Cull Off + //ZWrite Off + //ZTest Always + //Blend One One + + //###RenderAttribs + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + sampler2D _MainTex; + float4 _MainTex_TexelSize; + //sampler2D _RandTex; + //float4 _RandTex_TexelSize; + int _FrameCount; + float flipY; + + //#define iChannel0 _MainTex + //#define iChannel1 _RandTex + //#define iChannel2 _MainTex + + #include "glsl2Cg.cginc" + #include "shaderoo.cginc" + #define __UNITY3D__ + #define SHADEROO + #define __SHADEROO_GEOM + // define this, so that frag only funcs are also compiled + #define SHADEROO_FRAGMENT_SHADER + #include "Buff_A.cginc" + #undef SHADEROO_FRAGMENT_SHADER + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + //float4 vertex : TEXCOORD4; + #ifdef SHADEROO_GEOM + float4 vertAttr0: TEXCOORD1; + float4 vertAttr1: TEXCOORD2; + float4 vertAttr2: TEXCOORD3; + #endif + }; + + v2f vert (appdata v) + { + v2f o; + #ifdef SHADEROO_GEOM + float4 vertAttr[3] = { float4(0,0,0,0), float4(0,0,0,0), float4(0,0,0,0) }; + /*vertAttr[0]=float4(0,0,0,0); + vertAttr[1]=float4(0,0,0,0); + vertAttr[2]=float4(0,0,0,0);*/ + int vIdx=int(v.vertex.x+.1); + mainGeom(o.vertex,vertAttr,vIdx); + o.vertAttr0=vertAttr[0]; + o.vertAttr1=vertAttr[1]; + o.vertAttr2=vertAttr[2]; + #else + //o.vertex = UnityObjectToClipPos(float4(v.vertex.xyz, 1.0)); + o.vertex = v.vertex; + o.vertex.xy=o.vertex.xy*2.-1.; + o.uv = v.uv; + #endif + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float4 c; + #ifdef SHADEROO_GEOM + float4 vertAttr[3]; + vertAttr[0]=i.vertAttr0; + vertAttr[1]=i.vertAttr1; + vertAttr[2]=i.vertAttr2; + //FIXME: is +.5 really needed? + mainFragment(c,i.vertex/*+vec4(.5,.5,0,0)*/,vertAttr); + //mainFragment(c,vec4((i.vertex.xy*.5+.5)*iResolution.xy,i.vertex.zw),vertAttr); + #else + //FIXME: is +.5 really needed? + vec2 res=(i.vertex.xy/*+.5*/)/i.uv.xy; + if(flipY>.5) i.uv.y=1.-i.uv.y; + mainImage(c,i.uv*res.xy); + //mainImage(c,i.uv*512.0); + //if(flipY>.5) i.vertex.y=1.-i.vertex.y; + //mainImage(c,i.vertex.xy+vec2(.5,.5)); + #endif + return c; + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Resources/flockaroo_OilPainting/Buff_A.shader.meta b/Resources/flockaroo_OilPainting/Buff_A.shader.meta new file mode 100644 index 0000000..8adad06 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Buff_A.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f31706c430832401a9e64ab6c5790804 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/Geom_A.cginc b/Resources/flockaroo_OilPainting/Geom_A.cginc new file mode 100644 index 0000000..0c589ad --- /dev/null +++ b/Resources/flockaroo_OilPainting/Geom_A.cginc @@ -0,0 +1,346 @@ +// created by florian berger (flockaroo) - 2018 +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + +// oil paint brush drawing + +// calculating and drawing drawing the brush strokes + +#define MULTI_STROKE + +//#NumTriangles 0x10000 +#ifndef __UNITY3D__ +ivec2 ivec2i(int x) { return ivec2(x,x); } +ivec2 ivec2i(vec2 x) { return ivec2(x); } +vec2 vec2i(int x) { return vec2(x,x); } +vec2 vec2i(ivec2 x) { return vec2(x); } +vec2 vec2i(float x) { return vec2(x,x); } +vec3 vec3i(float x) { return vec3(x,x,x); } +vec3 vec3i(vec2 a, float b) { return vec3(a,b); } +vec3 vec3i(vec2 a, int b) { return vec3(a,b); } +vec4 vec4i(vec3 v,int x) { return vec4(v,x); } +#define mul(m,v) (v*m) +#endif + +#ifdef __UNITY3D__ +uniform int NumTriangles; +#else +#define NumTriangles 0x10000 +#endif + +#define Res (iResolution.xy) +#define Res0 vec2(textureSize(iChannel0,0)) +#define Res1 vec2(textureSize(iChannel1,0)) + +#define PI 3.1415927 + +#define N(v) (v.yx*vec2(1,-1)) + +vec4 getRand(vec2 pos) +{ + return textureLod(iChannel1,pos/Res1,0.); +} + +vec4 getRand(int idx) +{ + ivec2 rres=textureSize(iChannel1,0); + idx=idx%(rres.x*rres.y); + return texelFetch(iChannel1,ivec2(idx%rres.x,idx/rres.x),0); +} + +uniform float SrcContrast; +uniform float SrcBright; +uniform float SrcColor; +uniform float SrcBlur; + +vec4 getCol(vec2 pos, float lod) +{ + // use max(...) for fitting full image or min(...) for fitting only one dir + vec2 uv = (pos-.5*Res)*min(Res0.y/Res.y,Res0.x/Res.x)/Res0+.5; + vec2 mask = step(vec2i(-.5),-abs(uv-.5)); + vec4 c=textureLod(iChannel0,uv,lod+SrcBlur*(log2(Res.x)-1.)); + float br=dot(c.xyz,vec3(.333,.333,.333)); + c=(c-br)*SrcColor+br; + c=(c-.5)*SrcContrast+.5; + c*=SrcBright; + return clamp(c,0.,1.)*mask.x*mask.y; + //return clamp(((textureLod(iChannel0,uv,lod+SrcBlur*(log2(Res.x)-1.))-.5)*SrcContrast+.5*SrcBright),0.,1.)*mask.x*mask.y; +} + +uniform float FlickerStrength; +uniform float FlickerFreq; +float flickerParam; + +vec3 getValCol(vec2 pos, float lod) +{ + return getCol(pos,1.5+log2(Res0.x/600.)+lod).xyz*.7+getCol(pos,3.5+log2(Res0.x/600.)+lod).xyz*.3+.003*getRand(pos*.1+flickerParam*10.).xyz; + //return getCol(pos,.5+lod).xyz*.7+getCol(pos,lod+2.5).xyz*0.3+.003*getRand(pos*.1+iTime*FlickerStrength*10.).xyz; +} + +float compsignedmax(vec3 c) +{ + vec3 s=sign(c); + vec3 a=abs(c); + if (a.x>a.y && a.x>a.z) return c.x; + if (a.y>a.x && a.y>a.z) return c.y; + return c.z; +} + +vec2 getGradMax(vec2 pos, float eps) +{ + vec2 d=vec2(eps,0); + float lod = log2(2.*eps*Res0.x/Res.x); + lod=0.; + return vec2( + compsignedmax(getValCol(pos+d.xy,lod)-getValCol(pos-d.xy,lod)), + compsignedmax(getValCol(pos+d.yx,lod)-getValCol(pos-d.yx,lod)) + )/eps/2.; +} + +vec2 quad(vec2 p1, vec2 p2, vec2 p3, vec2 p4, int idx) +{ +#ifdef __UNITY3D__ + vec2 p[6] = {p1,p2,p3,p2,p4,p3}; +#else + vec2[6] p = vec2[6](p1,p2,p3,p2,p4,p3); +#endif + return p[idx%6]; +} + +uniform float BrushDetail; + +uniform float StrokeBend; + +int bitinv(int x, int bits) +{ + int ret=0; + for(int i=0;i>i)&1)<<(bits-1-i); + return ret; +} + +int SCRAMBLE(int idx, int num) +{ + return idx; + // sort of a generalized bit conversion - exchange half domains until smallest scale + int idx0=0; + for(int i=0;i<15;i++) + { + if(idx-idx0>=num-num/2) { idx=idx-(num-num/2); idx0+=0; num=num/2; } + else { idx=idx+num/2; idx0+=num/2; num=num-num/2; } + if (num<=0) break; + } + return idx; +} + +uniform float BrushSize; +//uniform float StrokeThresh; +uniform float LayerScale; +uniform float StrokeAng; +uniform float ColorSpread; + +#define CS(ang) cos(ang-vec2(0,PI/2.)) +mat2 ROT2(float ang) { vec2 b=CS(ang); return mat2(b,b.yx*vec2(-1,1)); } + +// HSV <-> RGB from http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl +vec3 rgb2hsv(vec3 c) +{ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +} + +vec3 hsv2rgb(vec3 c) +{ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + +void mainGeom( out vec4 vertCoord, inout vec4 vertAttrib[3], int vertIndex ) +{ + flickerParam = ((iTime-mod(iTime,1.0/max(FlickerFreq,1.)))*FlickerStrength); + vertCoord=vec4(0,0,0,1); + int pidx = vertIndex/6; + float idxFact = float(pidx)/float(NumTriangles/2); + + vec3 brushPos; + int layerScalePercent = int(floor(LayerScale*100.)); + float ls = pow(float(layerScalePercent)/100.,2.); + //float pow(ls, + int NumGrid=int(float(NumTriangles/2)*(1.-ls)); + float aspect=Res.x/Res.y; + int NumX = int(sqrt(float(NumGrid)*aspect)); + int NumY = int(sqrt(float(NumGrid)/aspect)); + //int pidx2 = NumX*NumY*4/3-pidx; + int pidx2 = NumTriangles/2-pidx; + int NumX2=NumX; + int NumY2=NumY; + int layer=0; + //int maxLayer=int(-log(float(NumY))/log(float(layerScalePercent)/100.)); + for(int i=0; i<20; i++) { if(pidx2max(Res.x,Res.y)*.1) ? 0. : wh; + //float StrokeThresh = iMouse.x/iResolution.x; + //wh = (layer!=int(StrokeThresh*20.)-1 && int(StrokeThresh*20.)>0) ? 0. : wh; + wh = (gl*BrushDetail<.003/wh0 && wh0a.y && a.x>a.z) return c.x; + if (a.y>a.x && a.y>a.z) return c.y; + return c.z; +} + +vec2 getGradMax(vec2 pos, float eps) +{ + vec2 d=vec2(eps,0); + float lod = log2(2.*eps*Res0.x/Res.x); + lod=0.; + return vec2( + compsignedmax(getValCol(pos+d.xy,lod)-getValCol(pos-d.xy,lod)), + compsignedmax(getValCol(pos+d.yx,lod)-getValCol(pos-d.yx,lod)) + )/eps/2.; +} + +vec2 quad(vec2 p1, vec2 p2, vec2 p3, vec2 p4, int idx) +{ +#ifdef __UNITY3D__ + vec2 p[6] = {p1,p2,p3,p2,p4,p3}; +#else + vec2[6] p = vec2[6](p1,p2,p3,p2,p4,p3); +#endif + return p[idx%6]; +} + +uniform float BrushDetail; + +uniform float StrokeBend; + +int bitinv(int x, int bits) +{ + int ret=0; + for(int i=0;i>i)&1)<<(bits-1-i); + return ret; +} + +int SCRAMBLE(int idx, int num) +{ + return idx; + // sort of a generalized bit conversion - exchange half domains until smallest scale + int idx0=0; + for(int i=0;i<15;i++) + { + if(idx-idx0>=num-num/2) { idx=idx-(num-num/2); idx0+=0; num=num/2; } + else { idx=idx+num/2; idx0+=num/2; num=num-num/2; } + if (num<=0) break; + } + return idx; +} + +uniform float BrushSize; +//uniform float StrokeThresh; +uniform float LayerScale; +uniform float StrokeAng; + +#define CS(ang) cos(ang-vec2(0,PI/2.)) +mat2 ROT2(float ang) { vec2 b=CS(ang); return mat2(b,b.yx*vec2(-1,1)); } + +void mainGeom( out vec4 vertCoord, inout vec4 vertAttrib[3], int vertIndex ) +{ + vertCoord=vec4(0,0,0,1); + int pidx = vertIndex/6; + float idxFact = float(pidx)/float(NumTriangles/2); + + vec3 brushPos; + //int layerScalePercent = int(floor(LayerScale*100.)); + float ls = pow(LayerScale,2.); + //float pow(ls, + int NumGrid=int(float(NumTriangles/2)*(1.-ls)); + float aspect=Res.x/Res.y; + int NumX = int(sqrt(float(NumGrid)*aspect)); + int NumY = int(sqrt(float(NumGrid)/aspect)); + //int pidx2 = NumX*NumY*4/3-pidx; + int pidx2 = NumTriangles/2-pidx; + int NumX2=NumX; + int NumY2=NumY; + int layer=0; + //int maxLayer=int(-log2(float(NumY))/log2(layerScale)); + int imax=8; + layer = imax; + for(int i=0; imax(Res.x,Res.y)*.1 && layer!=imax-1) ? 0. : wh; + //float StrokeThresh = iMouse.x/iResolution.x; + //wh = (layer!=int(StrokeThresh*20.)-1 && int(StrokeThresh*20.)>0) ? 0. : wh; + wh = (gl*BrushDetail<.003/wh0 && wh0=imax) ? 0. : wh; + + vec2 qc = quad( vec2(-1,-1), vec2(1,-1), vec2(-1,1), vec2(1,1), vertIndex ); + // calc the vertCoord of actual line segment + //vertCoord.xy = quad( -wh*n-lh*t, +wh*n-lh*t, -wh*n+lh*t, +wh*n+lh*t, vertIndex); + vertCoord.xy = mul(qc,mat2(wh*n,lh*t)); + vertCoord.xy = mul(vertCoord.xy,ROT2(StrokeAng)); + vertCoord.xy += brushPos.xy; + //vertCoord.xy -= wh0*.25*StrokeBend*n; + vertCoord.xy = vertCoord.xy/Res*2.-1.; + // bg plane for drawing canvas + vertCoord.xy = (pidx==0) ? qc : vertCoord.xy; + + vertCoord.z = brushPos.z*.01; + vertCoord.w = 1.; + + vertAttrib[1].xy = qc*.5+.5; + vertAttrib[0]=getCol(brushPos.xy,1.); + vertAttrib[0].w=idxFact; + vertAttrib[1].w=wh0; + vertAttrib[1].z=float(layer); + vertAttrib[2].x=float(pidx); + //if(int(iMouseData.w)/1!=0) + // vertAttrib[1].w=1.; +} + +uniform float Canvas; +uniform float StrokeSat; +uniform float StrokeContour; +uniform float StrokeDir; +uniform vec3 CanvasTint; + +float getCanv(vec2 fragCoord) +{ + float canv=0.; + canv=max(canv,(getRand(fragCoord.xy*vec2(.7,.03).xy)).x); + canv=max(canv,(getRand(fragCoord.xy*vec2(.7,.03).yx)).x); + canv-=.6; + return canv; +} + +#ifdef MULTI_STROKE +uniform vec2 strokeNumXY; +#endif + +float getStroke(vec2 uv, int pidx, vec2 fragCoord, float canv,vec2 d) +{ + uv.y*=1.-step(0.1,StrokeDir)*2.; + + vec4 rnd = getRand(pidx); + #ifdef SHADEROO_FRAGMENT_SHADER + uv+=dFdx(uv)*d.x; + uv+=dFdy(uv)*d.y; + #endif + uv+=.5; + #ifdef MULTI_STROKE + ivec2 xynum=ivec2i(max(vec2(strokeNumXY),vec2i(1))); + uv += vec2(pidx%xynum.x,(pidx/xynum.x)%xynum.y); + uv /= vec2i(xynum); + #endif + vec4 stroke = texture(iChannel2,uv); + float s = stroke.x; + float smask = stroke.y; + + fragCoord+=d; + + s+=clamp(1.-smask*5.,0.,1.)*getCanv(fragCoord)*Canvas*3.; + s+=clamp(1.-smask*5.,0.,1.)*(getRand(fragCoord.xy*.7).z-.5)*Canvas*1.5; + + return s; +} + +uniform float PaintShiny; +uniform float PaintSpec; +uniform float PaintDiff; +uniform float LightAng; +uniform float LightOffs; +uniform float halfFOV; +uniform float CanvasBg; + +void mainFragment( out vec4 fragColor, vec4 fragCoord, vec4 vertAttrib[3] ) +{ + int pidx = int(vertAttrib[2].x); + int layer = int(vertAttrib[1].z); + float wh0 = vertAttrib[1].w; + float canv=getCanv(fragCoord.xy); + + //float w=vertAttrib[0].w/iResolution.x; + // draw a line with smooth falloff + // triangular falloff + vec2 uv=vertAttrib[1].xy-.5; + vec3 n = vec3(0,0,1); + float s=getStroke(uv,pidx,fragCoord.xy,canv,vec2i(0)); + float s0=s; + #ifdef SHADEROO_FRAGMENT_SHADER + float ws=fwidth(s); + // use this for non 0-clamped tex + s=smoothstep(-ws,ws,s); + // use this for 0-clamped tex: + //s=clamp(s*10.,0.,1.); + #endif + vec2 d=vec2(.7,0); + vec2 g = vec2( + getStroke(uv,pidx,fragCoord.xy,canv,d.xy)-s0, + getStroke(uv,pidx,fragCoord.xy,canv,d.yx)-s0 + )/d.x; + n=normalize(vec3(-g,1.)); + + vec2 uvs=fragCoord.xy/Res; + vec2 cso=CS(LightOffs); + vec3 light = vec3i(CS(LightAng)*cso.y,cso.x); + float diff=clamp(dot(n,light),0.,1.0); + vec3 eyeDir = normalize(vec3i((-uvs*2.+1.)*tan(halfFOV)*vec2(1.0,Res.y/Res.x),1)); + float spec=clamp(dot(reflect(-light,n),eyeDir),0.0,1.0); + //spec=pow(spec,10.0); + spec=pow(spec,20.*PaintShiny+1.01)*(.5+PaintShiny); + + fragColor.xyz = vertAttrib[0].xyz*mix(1.,diff,PaintDiff)+spec*PaintSpec; + fragColor.w=s; + vec4 canvCol=vec4i(vec3i(mix(1.,canv+.5,.14*CanvasBg))*CanvasTint,1); + fragColor = pidx==0 ? canvCol : fragColor; +} + diff --git a/Resources/flockaroo_OilPainting/Geom_A.cginc.new.meta b/Resources/flockaroo_OilPainting/Geom_A.cginc.new.meta new file mode 100644 index 0000000..a7ed7d1 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Geom_A.cginc.new.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0151fdce4e93f404c95524c94c44bc24 +timeCreated: 1546642427 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/Geom_A.cginc.orig b/Resources/flockaroo_OilPainting/Geom_A.cginc.orig new file mode 100644 index 0000000..46d6962 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Geom_A.cginc.orig @@ -0,0 +1,314 @@ +// created by florian berger (flockaroo) - 2018 +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + +// oil paint brush drawing + +// calculating and drawing drawing the brush strokes + +#define MULTI_STROKE + +////#NumTriangles 0x10000 +#ifndef __UNITY3D__ +vec2 vec2i(float x) { return vec2(x,x); } +vec3 vec3i(float x) { return vec3(x,x,x); } +vec4 vec4i(vec3 v,int x) { return vec4(v,x); } +#define mul(m,v) (v*m) +#endif + +#ifdef __UNITY3D__ +uniform int NumTriangles; +#else +#define NumTriangles 0x10000 +#endif + +#define Res (iResolution.xy) +#define Res0 vec2(textureSize(iChannel0,0)) +#define Res1 vec2(textureSize(iChannel1,0)) + +#define PI 3.1415927 + +#define N(v) (v.yx*vec2(1,-1)) + +vec4 getRand(vec2 pos) +{ + return textureLod(iChannel1,pos/Res1,0.); +} + +vec4 getRand(int idx) +{ + ivec2 rres=textureSize(iChannel1,0); + idx=idx%(rres.x*rres.y); + return texelFetch(iChannel1,ivec2(idx%rres.x,idx/rres.x),0); +} + +uniform float SrcContrast; +uniform float SrcBright; +uniform float SrcBlur; + +vec4 getCol(vec2 pos, float lod) +{ + // use max(...) for fitting full image or min(...) for fitting only one dir + vec2 uv = (pos-.5*Res)*min(Res0.y/Res.y,Res0.x/Res.x)/Res0+.5; + vec2 mask = step(vec2i(-.5),-abs(uv-.5)); + return clamp(((textureLod(iChannel0,uv,lod+SrcBlur*(log2(Res.x)-1.))-.5)*SrcContrast+.5*SrcBright),0.,1.)*mask.x*mask.y; +} + +uniform float FlickerStrength; + +vec3 getValCol(vec2 pos, float lod) +{ + return getCol(pos,1.5+log2(Res0.x/600.)+lod).xyz*.7+getCol(pos,3.5+log2(Res0.x/600.)+lod).xyz*.3+.003*getRand(pos*.1+iTime*FlickerStrength*10.).xyz; + //return getCol(pos,.5+lod).xyz*.7+getCol(pos,lod+2.5).xyz*0.3+.003*getRand(pos*.1+iTime*FlickerStrength*10.).xyz; +} + +float compsignedmax(vec3 c) +{ + vec3 s=sign(c); + vec3 a=abs(c); + if (a.x>a.y && a.x>a.z) return c.x; + if (a.y>a.x && a.y>a.z) return c.y; + return c.z; +} + +vec2 getGradMax(vec2 pos, float eps) +{ + vec2 d=vec2(eps,0); + float lod = log2(2.*eps*Res0.x/Res.x); + lod=0.; + return vec2( + compsignedmax(getValCol(pos+d.xy,lod)-getValCol(pos-d.xy,lod)), + compsignedmax(getValCol(pos+d.yx,lod)-getValCol(pos-d.yx,lod)) + )/eps/2.; +} + +vec2 quad(vec2 p1, vec2 p2, vec2 p3, vec2 p4, int idx) +{ +#ifdef __UNITY3D__ + vec2 p[6] = {p1,p2,p3,p2,p4,p3}; +#else + vec2[6] p = vec2[6](p1,p2,p3,p2,p4,p3); +#endif + return p[idx%6]; +} + +uniform float BrushDetail; + +uniform float StrokeBend; + +int bitinv(int x, int bits) +{ + int ret=0; + for(int i=0;i>i)&1)<<(bits-1-i); + return ret; +} + +int SCRAMBLE(int idx, int num) +{ + return idx; + // sort of a generalized bit conversion - exchange half domains until smallest scale + int idx0=0; + for(int i=0;i<15;i++) + { + if(idx-idx0>=num-num/2) { idx=idx-(num-num/2); idx0+=0; num=num/2; } + else { idx=idx+num/2; idx0+=num/2; num=num-num/2; } + if (num<=0) break; + } + return idx; +} + +uniform float BrushSize; +//uniform float StrokeThresh; +uniform float LayerScale; +uniform float StrokeAng; + +#define CS(ang) cos(ang-vec2(0,PI/2.)) +mat2 ROT2(float ang) { vec2 b=CS(ang); return mat2(b,b.yx*vec2(-1,1)); } + +void mainGeom( out vec4 vertCoord, inout vec4 vertAttrib[3], int vertIndex ) +{ + vertCoord=vec4(0,0,0,1); + int pidx = vertIndex/6; + float idxFact = float(pidx)/float(NumTriangles/2); + + vec3 brushPos; + //int layerScalePercent = int(floor(LayerScale*100.)); + float ls = pow(LayerScale,2.); + //float pow(ls, + int NumGrid=int(float(NumTriangles/2)*(1.-ls)); + float aspect=Res.x/Res.y; + int NumX = int(sqrt(float(NumGrid)*aspect)); + int NumY = int(sqrt(float(NumGrid)/aspect)); + //int pidx2 = NumX*NumY*4/3-pidx; + int pidx2 = NumTriangles/2-pidx; + int NumX2=NumX; + int NumY2=NumY; + int layer=0; + //int maxLayer=int(-log2(float(NumY))/log2(layerScale)); + int imax=8; + layer = imax; + for(int i=0; imax(Res.x,Res.y)*.1 && layer!=imax-1) ? 0. : wh; + //float StrokeThresh = iMouse.x/iResolution.x; + //wh = (layer!=int(StrokeThresh*20.)-1 && int(StrokeThresh*20.)>0) ? 0. : wh; + wh = (gl*BrushDetail<.003/wh0 && wh0=imax) ? 0. : wh; + + vec2 qc = quad( vec2(-1,-1), vec2(1,-1), vec2(-1,1), vec2(1,1), vertIndex ); + // calc the vertCoord of actual line segment + //vertCoord.xy = quad( -wh*n-lh*t, +wh*n-lh*t, -wh*n+lh*t, +wh*n+lh*t, vertIndex); + vertCoord.xy = mul(qc,mat2(wh*n,lh*t)); + vertCoord.xy = mul(vertCoord.xy,ROT2(StrokeAng)); + vertCoord.xy += brushPos.xy; + //vertCoord.xy -= wh0*.25*StrokeBend*n; + vertCoord.xy = vertCoord.xy/Res*2.-1.; + // bg plane for drawing canvas + vertCoord.xy = (pidx==0) ? qc : vertCoord.xy; + + vertCoord.z = brushPos.z*.01; + vertCoord.w = 1.; + + vertAttrib[1].xy = qc*.5+.5; + vertAttrib[0]=getCol(brushPos.xy,1.); + vertAttrib[0].w=idxFact; + vertAttrib[1].w=wh0; + vertAttrib[1].z=float(layer); + vertAttrib[2].x=float(pidx); + //if(int(iMouseData.w)/1!=0) + // vertAttrib[1].w=1.; +} + +uniform float Canvas; +uniform float StrokeSat; +uniform float StrokeContour; +uniform float StrokeDir; +uniform vec3 CanvasTint; + +float getCanv(vec2 fragCoord) +{ + float canv=0.; + canv=max(canv,(getRand(fragCoord.xy*vec2(.7,.03).xy)).x); + canv=max(canv,(getRand(fragCoord.xy*vec2(.7,.03).yx)).x); + canv-=.6; + return canv; +} + +#ifdef MULTI_STROKE +uniform vec2 strokeNumXY; +#endif + +float getStroke(vec2 uv, int pidx, vec2 fragCoord, float canv,vec2 d) +{ + uv.y*=1.-step(0.1,StrokeDir)*2.; + + vec4 rnd = getRand(pidx); + #ifdef SHADEROO_FRAGMENT_SHADER + uv+=dFdx(uv)*d.x; + uv+=dFdy(uv)*d.y; + #endif + uv+=.5; + #ifdef MULTI_STROKE + ivec2 xynum=ivec2i(max(vec2(strokeNumXY),vec2i(1))); + uv += vec2(pidx%xynum.x,(pidx/xynum.x)%xynum.y); + uv /= vec2i(xynum); + #endif + vec4 stroke = texture(iChannel2,uv); + float s = stroke.x; + float smask = stroke.y; + + fragCoord+=d; + + s+=clamp(1.-smask*5.,0.,1.)*getCanv(fragCoord)*Canvas*3.; + s+=clamp(1.-smask*5.,0.,1.)*(getRand(fragCoord.xy*.7).z-.5)*Canvas*1.5; + + return s; +} + +uniform float PaintShiny; +uniform float PaintSpec; +uniform float PaintDiff; +uniform float LightAng; +uniform float LightOffs; +uniform float halfFOV; +uniform float CanvasBg; + +void mainFragment( out vec4 fragColor, vec4 fragCoord, vec4 vertAttrib[3] ) +{ + int pidx = int(vertAttrib[2].x); + int layer = int(vertAttrib[1].z); + float wh0 = vertAttrib[1].w; + float canv=getCanv(fragCoord.xy); + + //float w=vertAttrib[0].w/iResolution.x; + // draw a line with smooth falloff + // triangular falloff + vec2 uv=vertAttrib[1].xy-.5; + vec3 n = vec3(0,0,1); + float s=getStroke(uv,pidx,fragCoord.xy,canv,vec2i(0)); + float s0=s; + #ifdef SHADEROO_FRAGMENT_SHADER + float ws=fwidth(s); + // use this for non 0-clamped tex + s=smoothstep(-ws,ws,s); + // use this for 0-clamped tex: + //s=clamp(s*10.,0.,1.); + #endif + vec2 d=vec2(.7,0); + vec2 g = vec2( + getStroke(uv,pidx,fragCoord.xy,canv,d.xy)-s0, + getStroke(uv,pidx,fragCoord.xy,canv,d.yx)-s0 + )/d.x; + n=normalize(vec3(-g,1.)); + + vec2 uvs=fragCoord.xy/Res; + vec2 cso=CS(LightOffs); + vec3 light = vec3i(CS(LightAng)*cso.y,cso.x); + float diff=clamp(dot(n,light),0.,1.0); + vec3 eyeDir = normalize(vec3i((-uvs*2.+1.)*tan(halfFOV)*vec2(1.0,Res.y/Res.x),1)); + float spec=clamp(dot(reflect(-light,n),eyeDir),0.0,1.0); + //spec=pow(spec,10.0); + spec=pow(spec,20.*PaintShiny+1.01)*(.5+PaintShiny); + + fragColor.xyz = vertAttrib[0].xyz*mix(1.,diff,PaintDiff)+spec*PaintSpec; + fragColor.w=s; + vec4 canvCol=vec4i(vec3i(mix(1.,canv+.5,.14*CanvasBg))*CanvasTint,1); + fragColor = pidx==0 ? canvCol : fragColor; +} + diff --git a/Resources/flockaroo_OilPainting/Geom_A.cginc.orig.meta b/Resources/flockaroo_OilPainting/Geom_A.cginc.orig.meta new file mode 100644 index 0000000..be6015c --- /dev/null +++ b/Resources/flockaroo_OilPainting/Geom_A.cginc.orig.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9307082ca7291b42a76d24beff03791 +timeCreated: 1546642427 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/Geom_A.shader b/Resources/flockaroo_OilPainting/Geom_A.shader new file mode 100644 index 0000000..b89694f --- /dev/null +++ b/Resources/flockaroo_OilPainting/Geom_A.shader @@ -0,0 +1,124 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Geom_AShader" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + //_MainTexMip ("Texture", 2D) = "white" {} + //_RandTex("Texture", 2D) = "white" {} + + //_FrameCount("framecount", Int) = 0; + //flipY("Flip Y", Float) = 0.; + + //###ShaderUniforms + } + SubShader + { + // No culling or depth + Cull Off + //ZWrite Off + //ZTest Always + //Blend One One + + ZTest Always + Blend SrcAlpha OneMinusSrcAlpha + //###RenderAttribs + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + sampler2D _MainTex; + float4 _MainTex_TexelSize; + //sampler2D _RandTex; + //float4 _RandTex_TexelSize; + int _FrameCount; + float flipY; + float geomFlipY; + + //#define iChannel0 _MainTex + //#define iChannel1 _RandTex + //#define iChannel2 _MainTex + + #include "glsl2Cg.cginc" + #include "shaderoo.cginc" + #define __UNITY3D__ + #define SHADEROO + #define SHADEROO_GEOM + // define this, so that frag only funcs are also compiled + #define SHADEROO_FRAGMENT_SHADER + #include "Geom_A.cginc" + #undef SHADEROO_FRAGMENT_SHADER + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + //float4 vertex : TEXCOORD4; + #ifdef SHADEROO_GEOM + float4 vertAttr0: TEXCOORD1; + float4 vertAttr1: TEXCOORD2; + float4 vertAttr2: TEXCOORD3; + #endif + }; + + v2f vert (appdata v) + { + v2f o; + #ifdef SHADEROO_GEOM + float4 vertAttr[3] = { float4(0,0,0,0), float4(0,0,0,0), float4(0,0,0,0) }; + /*vertAttr[0]=float4(0,0,0,0); + vertAttr[1]=float4(0,0,0,0); + vertAttr[2]=float4(0,0,0,0);*/ + int vIdx=int(v.vertex.x+.1); + mainGeom(o.vertex,vertAttr,vIdx); + if(geomFlipY>.5) + o.vertex.y*=-1.; + o.vertAttr0=vertAttr[0]; + o.vertAttr1=vertAttr[1]; + o.vertAttr2=vertAttr[2]; + #else + //o.vertex = UnityObjectToClipPos(float4(v.vertex.xyz, 1.0)); + o.vertex = v.vertex; + o.vertex.xy=o.vertex.xy*2.-1.; + o.uv = v.uv; + #endif + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float4 c; + #ifdef SHADEROO_GEOM + float4 vertAttr[3]; + vertAttr[0]=i.vertAttr0; + vertAttr[1]=i.vertAttr1; + vertAttr[2]=i.vertAttr2; + //FIXME: is +.5 really needed? + mainFragment(c,i.vertex/*+vec4(.5,.5,0,0)*/,vertAttr); + //mainFragment(c,vec4((i.vertex.xy*.5+.5)*iResolution.xy,i.vertex.zw),vertAttr); + #else + //FIXME: is +.5 really needed? + vec2 res=(i.vertex.xy/*+.5*/)/i.uv.xy; + if(flipY>.5) i.uv.y=1.-i.uv.y; + mainImage(c,i.uv*res.xy); + //mainImage(c,i.uv*iResolution.xy); + //if(flipY>.5) i.vertex.y=1.-i.vertex.y; + //mainImage(c,i.vertex.xy+vec2(.5,.5)); + #endif + return c; + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Resources/flockaroo_OilPainting/Geom_A.shader.meta b/Resources/flockaroo_OilPainting/Geom_A.shader.meta new file mode 100644 index 0000000..06599c9 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Geom_A.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ce1734820593a45d7b0857130d72639c +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/Image.cginc b/Resources/flockaroo_OilPainting/Image.cginc new file mode 100644 index 0000000..8d61682 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Image.cginc @@ -0,0 +1,45 @@ +// created by florian berger (flockaroo) - 2018 +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + +// oil paint brush drawing + +// final mixing/vignetting/fading + +#define ImageTex iChannel0 + +#define Res iResolution.xy +#define Res0 vec2(textureSize(iChannel0,0)) +#define Res1 vec2(textureSize(iChannel1,0)) +#define Res2 vec2(textureSize(iChannel2,0)) +#define Res3 vec2(textureSize(iChannel3,0)) + +uniform float Vignette; + +uniform float EffectFade; + +uniform float PanFade; + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec2 uv = fragCoord/Res; + fragColor = texture(ImageTex,uv); + fragColor.w=1.; + vec2 uv2 = (fragCoord-.5*Res)*min(Res3.y/Res.y,Res3.x/Res.x)/Res3+.5; + vec4 col0 = texture(iChannel3,uv2); + fragColor = mix(fragColor,col0,EffectFade); +#define PANFADE_W 0.025 + fragColor.xyz=mix(fragColor.xyz,col0.xyz,smoothstep((1.-PanFade)-PANFADE_W,(1.-PanFade)+PANFADE_W,((1.-fragCoord.x/iResolution.x)-.5)/(1.+2.*PANFADE_W)+.5)); + + if(true) + { + vec2 scc=(fragCoord-.5*iResolution.xy)/iResolution.x; + float vign = 1.0-Vignette*dot(scc,scc)*1.3; + //float vign = 1.0; + vign*=1.-Vignette*exp(-sin(fragCoord.x/iResolution.x*3.1416)*40.); + vign*=1.-Vignette*exp(-sin(fragCoord.y/iResolution.y*3.1416)*20.); + fragColor.xyz *= vign; + } + //fragColor = texture(iChannel2,fragCoord/Res); + fragColor.w = 1.; +} + diff --git a/Resources/flockaroo_OilPainting/Image.cginc.meta b/Resources/flockaroo_OilPainting/Image.cginc.meta new file mode 100644 index 0000000..40e2a65 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Image.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 56ffa20020b51486bb6b397f3a275a92 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/Image.shader b/Resources/flockaroo_OilPainting/Image.shader new file mode 100644 index 0000000..786fb14 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Image.shader @@ -0,0 +1,119 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/ImageShader" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + //_MainTexMip ("Texture", 2D) = "white" {} + //_RandTex("Texture", 2D) = "white" {} + + //_FrameCount("framecount", Int) = 0; + //flipY("Flip Y", Float) = 0.; + + //###ShaderUniforms + } + SubShader + { + // No culling or depth + Cull Off + //ZWrite Off + //ZTest Always + //Blend One One + + //###RenderAttribs + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + sampler2D _MainTex; + float4 _MainTex_TexelSize; + //sampler2D _RandTex; + //float4 _RandTex_TexelSize; + int _FrameCount; + float flipY; + + //#define iChannel0 _MainTex + //#define iChannel1 _RandTex + //#define iChannel2 _MainTex + + #include "glsl2Cg.cginc" + #include "shaderoo.cginc" + #define __UNITY3D__ + #define SHADEROO + #define __SHADEROO_GEOM + // define this, so that frag only funcs are also compiled + #define SHADEROO_FRAGMENT_SHADER + #include "Image.cginc" + #undef SHADEROO_FRAGMENT_SHADER + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + //float4 vertex : TEXCOORD4; + #ifdef SHADEROO_GEOM + float4 vertAttr0: TEXCOORD1; + float4 vertAttr1: TEXCOORD2; + float4 vertAttr2: TEXCOORD3; + #endif + }; + + v2f vert (appdata v) + { + v2f o; + #ifdef SHADEROO_GEOM + float4 vertAttr[3] = { float4(0,0,0,0), float4(0,0,0,0), float4(0,0,0,0) }; + /*vertAttr[0]=float4(0,0,0,0); + vertAttr[1]=float4(0,0,0,0); + vertAttr[2]=float4(0,0,0,0);*/ + int vIdx=int(v.vertex.x+.1); + mainGeom(o.vertex,vertAttr,vIdx); + o.vertAttr0=vertAttr[0]; + o.vertAttr1=vertAttr[1]; + o.vertAttr2=vertAttr[2]; + #else + //o.vertex = UnityObjectToClipPos(float4(v.vertex.xyz, 1.0)); + o.vertex = v.vertex; + o.vertex.xy=o.vertex.xy*2.-1.; + o.uv = v.uv; + #endif + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float4 c; + #ifdef SHADEROO_GEOM + float4 vertAttr[3]; + vertAttr[0]=i.vertAttr0; + vertAttr[1]=i.vertAttr1; + vertAttr[2]=i.vertAttr2; + //FIXME: is +.5 really needed? + mainFragment(c,i.vertex/*+vec4(.5,.5,0,0)*/,vertAttr); + //mainFragment(c,vec4((i.vertex.xy*.5+.5)*iResolution.xy,i.vertex.zw),vertAttr); + #else + //FIXME: is +.5 really needed? + vec2 res=(i.vertex.xy/*+.5*/)/i.uv.xy; + if(flipY>.5) i.uv.y=1.-i.uv.y; + //mainImage(c,i.uv*res.xy); + mainImage(c,i.uv*iResolution.xy); + //if(flipY>.5) i.vertex.y=1.-i.vertex.y; + //mainImage(c,i.vertex.xy+vec2(.5,.5)); + #endif + return c; + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Resources/flockaroo_OilPainting/Image.shader.meta b/Resources/flockaroo_OilPainting/Image.shader.meta new file mode 100644 index 0000000..dcf3ef8 --- /dev/null +++ b/Resources/flockaroo_OilPainting/Image.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5ce624c6dda054e5ebc566562bf05751 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/flockaroo_OilPainting/glsl2Cg.cginc b/Resources/flockaroo_OilPainting/glsl2Cg.cginc new file mode 100644 index 0000000..8bccd0e --- /dev/null +++ b/Resources/flockaroo_OilPainting/glsl2Cg.cginc @@ -0,0 +1,164 @@ +// glsl -> Cg +// many things can be covered here, but... +// not possible by typedef or #define are: +// (at least not with the limited preprocess abilities of Cg) +// +// array initializers +// glsl: type arr[n] = type[](a,b,c,...); +// Cg: type arr[n] = {a,b,c,...} +// +// vec initializers with 1 arg: +// glsl: vec4(x) +// Cg: vec4i(x) (see helpers below - or float4(x,x,x,x)) +// +// matrix multiplications +// glsl: m*v +// Cg: mul(m,v) +// +// matrix initializers (column first in glsl) +// glsl: mat4(a,b,c,...) +// Cg: transpose(mat4(a,b,c,...)) +// (or dont transpose and use mulX(m,v) defined below) +// +// forget global variables (even const ones) - need to be defines in Cg +// +// in mainGeom(...) vertAttrib[] not initialized +// so either inout as argument, or actually init them in mainGeom() +// + +float4 vec4i(float x) { return float4(x,x,x,x); } +float4 vec4i(float x, float3 v) { return float4(x,v.x,v.y,v.z); } +float4 vec4i(float3 v, float x) { return float4(v.x,v.y,v.z,x); } +float4 vec4i(float2 v1, float2 v2) { return float4(v1.x,v1.y,v2.x,v2.y); } +float4 vec4i(float2 v, float z, float w) { return float4(v.x,v.y,z,w); } +float4 vec4i(float x, float y, float2 v) { return float4(x,y,v.x,v.y); } +float4 vec4i(float x, float y, float z, float w) { return float4(x,y,z,w); } +float3 vec3i(float x) { return float3(x,x,x); } +float3 vec3i(float3 v) { return v; } +float3 vec3i(float2 v, float x) { return float3(v.x,v.y,x); } +float3 vec3i(float x, float2 v) { return float3(x,v.x,v.y); } +float3 vec3i(float x, float y, float z) { return float3(x,y,z); } +float2 vec2i(float2 v) { return v; } +float2 vec2i(float x) { return float2(x,x); } +float2 vec2i(float x, float y) { return float2(x,y); } +int2 ivec2i(float2 v) { return int2(v); } +int2 ivec2i(float x) { return int2(x,x); } +int3 ivec3i(float x) { return int3(x,x,x); } +int4 ivec4i(float x) { return int4(x,x,x,x); } + +// use this for matrix multiplications (same as transpose(m)*v) +#define mulX(a,b) mul(b,a) + +//float4 clamp(float4 v, float a, float b) { return clamp(v,float4(a,a,a,a),float4(b,b,b,b)); } +//float3 clamp(float3 v, float a, float b) { return clamp(v,float3(a,a,a),float3(b,b,b)); } +//float2 clamp(float2 v, float a, float b) { return clamp(v,float2(a,a),float2(b,b)); } + +typedef float2 vec2; +typedef float3 vec3; +typedef float4 vec4; +typedef int4 ivec4; +typedef int3 ivec3; +typedef int2 ivec2; +typedef float4x4 mat4; +typedef float3x3 mat3; +typedef float2x2 mat2; + +#define atan(a,b) atan2(a,b) +#define texture textureX +//#define texture(a,b) tex2D(a,b) +float4 textureX(sampler2D s, float2 uv, float bias) { return tex2Dbias(s,float4(uv,0,bias)); } +// use this instead of above when needed in vertex shader (bias makes no sense there!!!) +//float4 textureX(sampler2D s, float2 uv, float bias) { return tex2Dlod(s,float4(uv,0,bias)); } +float4 textureX(sampler2D s, float2 uv) { return tex2D(s,uv); } +//#define texture(a,b,c) tex2Dbias(a,float4(b,0,c)) +#define textureLod(a,b,c) tex2Dlod(a,float4(b,0,c)) +//#define textureLod(a,b,c) tex2D(a,b) +//#define texelFetch(a,b,c) tex2Dfetch(a,int4(b,0,c)) +#define texelFetch(a,b,c) tex2Dlod(a,float4((float2(b)+.5)/float2(textureSize(a,0)),0,c)) + +//#define GET_VARARG_MACRO(_1,_2,_3,_4,NAME,...) NAME +//#define vec4(...) GET_VARARG_MACRO(__VA_ARGS__, vec4i, vec4i, vec4i, vec4i, vec4)(__VA_ARGS__) +//#define vec4 float4 +//#define vec3 float3 +//#define vec2 float2 +//#define ivec4 int4 +//#define ivec3 int3 +//#define ivec2 int2 +//#define mat4 float4x4 +//#define mat3 float3x3 +//#define mat2 float2x2 + +#define dFdx(x) ddx(x) +#define dFdy(x) ddy(x) + +#define mix(a,b,c) lerp(a,b,c) + +#define fract(a) frac(a) +#define mod(a,b) fmod(a,b) + +#define textureSize(a,b) (a##_TexelSize.zw/(1< meshes; + + // Use this for initialization + + /*protected Material mat + { + get + { + if (m_Material == null) + { + m_Material = new Material(shader); + m_Material.hideFlags = HideFlags.HideAndDontSave; + } + return m_Material; + } + }*/ + + void initShader() + { + + if (shader == null) + { + if(shaderMethod==0) + shader = Resources.Load("flockaroo_ColoredPencils/imageEffShader"); + if(shaderMethod==1) + shader = Resources.Load("flockaroo_ColoredPencils/imageEffShader1"); + } + //if (shader == null) + // shader = Resources.Load("Assets/pencil-effect/imageEffShader"); + } + + void initRandTex() + { + //if (RandTex == null) + // RandTex = Resources.Load("rand256"); + if (RandTex == null) + { + //RandTex = new Texture2D(256, 256, TextureFormat.RGBAFloat, true); + //RandTex = new Texture2D(256, 256, TextureFormat.RGBAHalf, true); + RandTex = new Texture2D(256, 256, TextureFormat.RGBA32, true); + + for (int x = 0; x < RandTex.width; x++) + { + for (int y = 0; y < RandTex.height; y++) + { + float r = Random.Range(0.0f, 1.0f); + float g = Random.Range(0.0f, 1.0f); + float b = Random.Range(0.0f, 1.0f); + float a = Random.Range(0.0f, 1.0f); + RandTex.SetPixel(x, y, new Color(r, g, b, a) ); + } + } + + RandTex.Apply(); + } + } + + void initMipmapRenderTexture(RenderTexture src) + { + if(rtmip == null) + { + rtmip = new RenderTexture(src.width, src.height,0,RenderTextureFormat.ARGB32); + //rtmip = new RenderTexture(src); + rtmip.antiAliasing=1; // must be for mipmapping to work!! + rtmip.useMipMap=true; +#if UNITY_5_5_OR_NEWER + //rtmip.autoGenerateMips=false; +#endif + } + + } + + void Start () { + initShader(); + initRandTex(); + if (isShaderooGeom) + { + meshes = new List(); + int trinum = 300000; + int maxMeshSize = 0x10000/3*3; + int mnum = (trinum*3+maxMeshSize-1)/maxMeshSize; + for(int j=0;j().mesh = mesh; + int vnum = maxMeshSize; + Vector3[] verts = new Vector3 [vnum]; + //Vector2[] uvs = new Vector2 [vnum]; + int[] tris = new int [vnum]; + for(int i=0;i0.0001f); + + if (useMipmaps) + { + initMipmapRenderTexture(mySrc); + Graphics.Blit(mySrc, rtmip); +#if UNITY_5_5_OR_NEWER + //rtmip.GenerateMips(); +#endif + Graphics.SetRenderTarget(dest); + mat.SetTexture("_MainTex", rtmip); + Graphics.Blit(rtmip, dest, mat); + //rtmip.filterMode = FilterMode.Trilinear; + } + else + { + mat.SetTexture("_MainTex", src); + + if(isShaderooGeom) + { + //initMipmapRenderTexture(src); + Graphics.Blit(src, dest); + //Graphics.SetRenderTarget(rtmip); + //rtmip.DiscardContents(true,true); + //Graphics.SetRenderTarget(dest); + mat.SetPass(0); + foreach(Mesh mesh in meshes) + { + Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity); + } + //rtmip.GenerateMips(); + //Graphics.SetRenderTarget(dest); + //Graphics.Blit(rtmip, dest); + } + else + { + if(outputTexture) + { + Graphics.Blit(mySrc, outputTexture, mat); + // default blit of screen - no effect + Graphics.Blit(src, dest); + } + else + Graphics.Blit(mySrc, dest, mat); + } + } + } + /*public void OnPostRender() { + if (mat == null) + { + mat = new Material(shader); + mat.hideFlags = HideFlags.HideAndDontSave; + } + mat.SetPass(0); + Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity); + }*/ + +} +} \ No newline at end of file diff --git a/Runtime/ColoredPencils/ColoredPencilsEffect.cs.meta b/Runtime/ColoredPencils/ColoredPencilsEffect.cs.meta new file mode 100644 index 0000000..b5bfb0e --- /dev/null +++ b/Runtime/ColoredPencils/ColoredPencilsEffect.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 79621082da8ba124eba3da9eba119a06 +timeCreated: 1529867923 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ColoredPencils/Readme.pdf b/Runtime/ColoredPencils/Readme.pdf new file mode 100644 index 0000000..c4056b9 Binary files /dev/null and b/Runtime/ColoredPencils/Readme.pdf differ diff --git a/Runtime/ColoredPencils/Readme.pdf.meta b/Runtime/ColoredPencils/Readme.pdf.meta new file mode 100644 index 0000000..1e5af09 --- /dev/null +++ b/Runtime/ColoredPencils/Readme.pdf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b242660a58802d04cb1102491d84a2b9 +timeCreated: 1531243294 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ColoredPencils/Readme.txt b/Runtime/ColoredPencils/Readme.txt new file mode 100644 index 0000000..5896a92 --- /dev/null +++ b/Runtime/ColoredPencils/Readme.txt @@ -0,0 +1,70 @@ +# Colored Pencils - Unity3D Image Effect +#### (c) 2018 by [flockaroo](http://www.flockaroo.at) (Florian Berger) - email: + +****** + +### How to use + +Select your camera node and then simply add "ColoredPencilsEffect" script to camera components (can be found in Assets/flockaroo/ColoredPencils/). +You can drag/drop it to there or choose it from the menu (Component/Scripts/Flockaroo/ColoredPencils). + +![How to use - Image](/unityprj/Unity_ColoredPencils/Assets/flockaroo/ColoredPencils/howto.png){ width="100%" } + +__Warning!!__ The subfolder "flockaroo_[effect name]" in "Resources" is needed by the effect script for unique identification of files and should not be removed or renamed. + +
+ +### Parameters + +The shader provides the following parameters: + +#### Input/Output + | Parameter | function + |-----------------|-------------- + | Input Texture | take this texture as input instead of the camera + | Render To Texture | render to texture instead of screen + | Output Texture | texture being rendered to if above is checked + | Output Mipmap | generate mipmap for output texture + +#### Main faders + | Parameter | function + |-----------------|-------------- + | Fade | 0 = effect image ... 1 = original content + | Pan Fade | 0 = effect image ... 1 = original content - pan from left to right + +#### Source + | Parameter | function + |-----------------|-------------- + | Brightness | adjust brightness of the content before applying the effect + | Contrast | adjust contrast of the content before applying the effect + | Color | the color intensity of the effect + +#### Effect + | Parameter | function + |-----------------|-------------- + | Shader Method | 0 = original shader
1 = newer version (faster, other color scheme) + | Outlines | strength of the pencil outlines + | Hatches | strength of the pencil hatches + | Outline Error | drawing-error of the pencil outlines + | Flicker | activates a flicker effect on cross-hatches and outlines + | Flicker Freq | flicker frequency in Hz + | Fixed Hatch Dir | makes crosshatches all parallel and content independent + | Hatch Scale | scale of the hatch strokes (line thickness) + | Hatch Length | length of the hatch strokes + | Mip Level | affects the detail of the strokes, and slightly disorients the strokes direction close to color jumps (only works properly for Unity versions higher than 5.5) + | Vignetting | darkening the window border + | Content Vignetting | fade content to white paper on border + +
+ +#### Background + | Parameter | function + |-----------------|-------------- + | Paper Tint | color of the paper being drawn on + | Paper Roughness | roughness of paper surface + | Paper Texture | custom paper texture (background) + +#### Other + | Parameter | function + |-----------------|-------------- + | Flip Y | image Y flip diff --git a/Runtime/ColoredPencils/Readme.txt.meta b/Runtime/ColoredPencils/Readme.txt.meta new file mode 100644 index 0000000..68249bd --- /dev/null +++ b/Runtime/ColoredPencils/Readme.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 16a5051bb3c65104dbd623d3dfdaceb3 +timeCreated: 1531243306 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/ColoredPencils/howto.png b/Runtime/ColoredPencils/howto.png new file mode 100644 index 0000000..344c541 Binary files /dev/null and b/Runtime/ColoredPencils/howto.png differ diff --git a/Runtime/ColoredPencils/howto.png.meta b/Runtime/ColoredPencils/howto.png.meta new file mode 100644 index 0000000..5ccf455 --- /dev/null +++ b/Runtime/ColoredPencils/howto.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: f5c5571ab67843044b2f0e774146b2ae +timeCreated: 1531243301 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/OilPainting.meta b/Runtime/OilPainting.meta new file mode 100644 index 0000000..e967222 --- /dev/null +++ b/Runtime/OilPainting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5912791aaab07984ea2513ca03d988aa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/OilPainting/OilPaintingEffect.cs b/Runtime/OilPainting/OilPaintingEffect.cs new file mode 100644 index 0000000..533ae7a --- /dev/null +++ b/Runtime/OilPainting/OilPaintingEffect.cs @@ -0,0 +1,421 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using UnityEngine; + +namespace Flockaroo +{ +[ExecuteInEditMode] +[RequireComponent(typeof (Camera))] +//[AddComponentMenu("Image Effects/Artistic/OilPainting")] +public class OilPaintingEffect : MonoBehaviour { + + List bufferOrder = new List (); + Dictionary buffers = new Dictionary(); + Dictionary shaders = new Dictionary(); + Dictionary textures = new Dictionary(); + Dictionary> textureCh = new Dictionary>(); + Dictionary> textureDemandsMip = new Dictionary>(); + Dictionary> meshes = new Dictionary>(); + RenderTexture mainTex = null; + RenderTexture mainMip = null; + Regex refRegex = new Regex(@"Ref:([^:]+):Tex([0-9]+)"); + private int actWidth=0; + private int actHeight=0; + private int NumTriangles=0; + + //FIXME: automate useMipOnMain - activate when needed + private bool useMipOnMain = false; + + [Header("Input/Output")] + + [Tooltip("take a texture as input instead of the camera")] + public Texture inputTexture; + [Tooltip("render to a texture instead of the screen")] + public bool renderToTexture; + [Tooltip("texture being rendered to if above is checked")] + public RenderTexture outputTexture; + [Tooltip("generate mipmap for output texture")] + public bool outputMipmap; + + [Header("Common")] + + [Range(0.0f,1.0f)] + public float EffectFade = 0.0f; + [Range(0.0f,1.0f)] + public float PanFade = 0.0f; + + [Header("Source")] + + [Range(0.0f,2.0f)] + public float SrcBright = 1.0f; + [Range(0.0f,2.0f)] + public float SrcContrast = 1.4f; + [Range(0.0f,4.0f)] + public float SrcColor = 1.0f; + [Range(0.0f,1.0f)] + public float SrcBlur = 0.0f; + + [Header("Effect")] + + [Range(0.0f,1.0f)] + public float BrushDetail = 0.1f; + [Range(0.0f,1.0f)] + public float BrushFill = 0.5f; + [Range(5000,200000)] + public int NumStrokes=0x8000; + [Range(0.5f,0.95f)] + public float LayerScale = 0.8f; + [Range(0.0f,1.0f)] + public float Canvas = 0.4f; + [Range(0.0f,100.0f)] + public float FlickerFreq = 15.0f; + [Range(0.0f,1.0f)] + public float FlickerStrength = 0.0f; + [Range(0.0f,360.0f)] + public float LightAng = 135.0f; + [Range(0.0f,90.0f)] + public float LightOffs = 60.0f; + [Range(0.0f,1.0f)] + public float PaintDiff = 0.15f; + [Range(0.0f,1.0f)] + public float PaintSpec = 0.15f; + [Range(0.0f,1.0f)] + public float PaintShiny = 0.5f; + [Range(0.0f,2.0f)] + public float ColorSpread = 0.0f; + [Range(0.0f,120.0f)] + public float ScreenFOV = 0.0f; + [Range(0.0f,360.0f)] + public float StrokeAng = 0.0f; + [Range(-1.0f,1.0f)] + public float StrokeBend = -1.0f; + [Range(0.0f,1.0f)] + public float StrokeDir = 0.0f; + [Range(0.0f,1.0f)] + public float StrokeContour = 1.0f; + [Range(0.0f,16.0f)] + public float MultiStroke = 6.0f; + [Range(0.0f,100000.0f)] + public float strokeSeed = 10.0f; + [Range(0.0f,1.0f)] + public float Vignette = 1.0f; + [Range(0.0f,1.0f)] + public float CanvasBg = 0.5f; + public Color CanvasTint = new Color(1.0f,0.97f,0.85f); + //###PublicVars + [Header("Other")] + public bool flipY=false; + public bool geomFlipY=false; + + Material createShader(string resname) + { + Shader shader = Resources.Load(resname); + Material mat = new Material(shader); + mat.hideFlags = HideFlags.HideAndDontSave; + return mat; + } + + RenderTexture createRenderTex(int w = -1, int h = -1, bool mip = false, int aa = 1) + { + RenderTexture rt; + //if(w==-1) w=Screen.width; + //if(h==-1) h=Screen.height; + if(w==-1) w=actWidth; + if(h==-1) h=actHeight; + rt = new RenderTexture(w, h,0,RenderTextureFormat.ARGBFloat); + rt.antiAliasing=aa; // must be 1 for mipmapping to work!! + rt.useMipMap=mip; + if(mip) + rt.filterMode=FilterMode.Trilinear; + return rt; + } + + Texture2D createRandTex(int w, int h) + { + //if (RandTex == null) + // RandTex = Resources.Load("rand256"); + Texture2D RandTex; + { + RandTex = new Texture2D(w, h, TextureFormat.RGBAFloat, true); + //RandTex = new Texture2D(w, h, TextureFormat.RGBAHalf, true); + //RandTex = new Texture2D(w, h, TextureFormat.RGBA32, true); + + for (int x = 0; x < RandTex.width; x++) + { + for (int y = 0; y < RandTex.height; y++) + { + float r = Random.Range(0.0f, 1.0f); + float g = Random.Range(0.0f, 1.0f); + float b = Random.Range(0.0f, 1.0f); + float a = Random.Range(0.0f, 1.0f); + RandTex.SetPixel(x, y, new Color(r, g, b, a) ); + } + } + + RandTex.Apply(); + } + RandTex.filterMode=FilterMode.Trilinear; + return RandTex; + } + + List createMesh(int trinum = 0x10000) + { + List meshes = new List(); + int maxMeshSize = 0x10000/3*3; + int mnum = (trinum*3+maxMeshSize-1)/maxMeshSize; + for(int j=0;j (); + textureDemandsMip["Buff_A"] = new Dictionary (); + shaders["Buff_A"] = createShader("flockaroo_OilPainting/Buff_A"); + textureCh["Buff_A"][0] = "none"; + textureCh["Buff_A"][1] = "rand256"; + textureCh["Buff_A"][2] = "Buff_A"; + buffers["Buff_A"].width=512; + buffers["Buff_A"].height=512; + buffers["Buff_A"].useMipMap=true; + buffers["Buff_A"].filterMode=FilterMode.Trilinear; + bufferOrder.Add("Geom_A"); + buffers["Geom_A"] = createRenderTex(); + buffers["Geom_A"].depth = 24; + textureCh["Geom_A"] = new Dictionary (); + textureDemandsMip["Geom_A"] = new Dictionary (); + shaders["Geom_A"] = createShader("flockaroo_OilPainting/Geom_A"); + meshes["Geom_A"] = createMesh(NumStrokes*2); + NumTriangles=NumStrokes*2; + textureCh["Geom_A"][0] = "https://ak1.picdn.net/shutterstock/videos/15325111/preview/stock-footage-beautiful-young-woman-enjoying-her-vacation-on-santorini-happy-tourist-is-wearing-sunhat.webm"; + textureCh["Geom_A"][1] = "rand256"; + textureCh["Geom_A"][2] = "Buff_A"; + textureDemandsMip["Geom_A"][0]=true; + bufferOrder.Add("Image"); + buffers["Image"] = createRenderTex(); + textureCh["Image"] = new Dictionary (); + textureDemandsMip["Image"] = new Dictionary (); + shaders["Image"] = createShader("flockaroo_OilPainting/Image"); + textureCh["Image"][0] = "Geom_A"; + textureCh["Image"][1] = "rand256"; + textureCh["Image"][2] = "Buff_A"; + textureCh["Image"][3] = "https://ak1.picdn.net/shutterstock/videos/15325111/preview/stock-footage-beautiful-young-woman-enjoying-her-vacation-on-santorini-happy-tourist-is-wearing-sunhat.webm"; + + //###InitMarker + } + + void Start () { + //initAll(Screen.width,Screen.height); + } + + // Update is called once per frame + void Update () { + + } + + Texture getTexture(string name) + { + if(name.StartsWith("Ref:")) { + Match match = refRegex.Match(name); + if (match.Success) + { + string buff = match.Groups[1].Value; + int chan = int.Parse(match.Groups[2].Value); + return getTexture(textureCh[buff][chan]); + } + return null; + } + if(buffers.ContainsKey(name)) return buffers[name]; + if(textures.ContainsKey(name)) return textures[name]; + if(name.EndsWith(".mp4")) return mainTex; + if(name.EndsWith(".webm")) return mainTex; + return mainTex; + // FIXME: alloc textures if not present + //return textures["rand256"]; + } + + private void OnRenderImage(RenderTexture src, RenderTexture dest) { + mainTex=src; + bool reinit=false; + + if(inputTexture) + { + mainTex = new RenderTexture(inputTexture.width, inputTexture.height, 0, RenderTextureFormat.ARGBFloat); + Graphics.Blit(inputTexture, mainTex); + } + + if (renderToTexture && outputTexture==null) { reinit=true; } + if (!renderToTexture && outputTexture!=null) { reinit=true; } + + if( mainTex.width!=actWidth || mainTex.height!=actHeight || reinit ) + { + Debug.Log("OilPainting 1st init (or Resolution changed)"); + initAll(mainTex.width,mainTex.height); + } + + if(NumTriangles!=NumStrokes*2) + { + meshes["Geom_A"] = createMesh(NumStrokes*2); + NumTriangles=NumStrokes*2; + } + + if(useMipOnMain) + { + initMainMipmapRenderTexture(mainTex); + Graphics.Blit(mainTex, mainMip); + mainTex = mainMip; + } + + foreach( string buffName in bufferOrder ) + { + Material mat = null; + if(shaders.ContainsKey(buffName)) mat = shaders[buffName]; + if(mat==null) { continue; } + + mat.SetFloat("geomFlipY", geomFlipY?1.0f:0.0f); + mat.SetFloat("flipY", flipY?1.0f:0.0f); + mat.SetInt("_FrameCount", Time.frameCount); + + mat.SetFloat("BrushDetail",(BrushDetail*0.8f+0.2f)*(BrushDetail*0.8f+0.2f)); + mat.SetFloat("BrushSize",BrushFill*2.0f+0.25f); + mat.SetFloat("Canvas",Canvas); + mat.SetFloat("EffectFade",EffectFade); + mat.SetFloat("FlickerFreq",FlickerFreq); + mat.SetFloat("FlickerStrength",FlickerStrength); + mat.SetFloat("halfFOV",ScreenFOV/180.0f*3.14159265359f*0.5f); + mat.SetFloat("LayerScale",LayerScale); + mat.SetFloat("LightAng",LightAng/180.0f*3.14159265359f); + mat.SetFloat("LightOffs",LightOffs/180.0f*3.14159265359f); + mat.SetFloat("NumTriangles",NumStrokes*2); + mat.SetFloat("PaintDiff",PaintDiff); + mat.SetFloat("PaintSpec",PaintSpec); + mat.SetFloat("PaintShiny",PaintShiny); + mat.SetFloat("PanFade",PanFade); + mat.SetFloat("SrcBlur",SrcBlur); + mat.SetFloat("SrcBright",SrcBright); + mat.SetFloat("SrcContrast",SrcContrast); + mat.SetFloat("SrcColor",SrcColor); + mat.SetFloat("ColorSpread",ColorSpread); + mat.SetFloat("StrokeAng",StrokeAng/180.0f*3.14159265359f); + mat.SetFloat("StrokeBend",StrokeBend); + mat.SetFloat("StrokeContour",StrokeContour); + mat.SetFloat("StrokeDir",StrokeDir); + mat.SetVector("strokeNumXY",new Vector4(MultiStroke,MultiStroke,0.0f,0.0f)); + mat.SetFloat("strokeSeed",strokeSeed); + mat.SetFloat("Vignette",Vignette); + mat.SetColor("CanvasTint", CanvasTint); + mat.SetFloat("CanvasBg", CanvasBg); + //###MatParams + + for(int i=0;i<8;i++) + { + if(textureCh.ContainsKey(buffName) && + textureCh[buffName].ContainsKey(i)) + { + Texture tex = getTexture(textureCh[buffName][i]); + if(mat!=null) mat.SetTexture("iChannel"+i, tex); + if(textureDemandsMip.ContainsKey(buffName) && + textureDemandsMip[buffName].ContainsKey(i) && + textureDemandsMip[buffName][i]) + { + if(tex==mainTex) useMipOnMain=true; + else if(tex is RenderTexture) ((RenderTexture)tex).useMipMap=true; + } + } + } + + if(meshes.ContainsKey(buffName)) + { + Graphics.SetRenderTarget(buffers[buffName]); + GL.Clear(true, true, Color.clear); + if(mat!=null) mat.SetPass(0); + foreach(Mesh mesh in meshes[buffName]) + { + Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity); + } + } + else + { + if(buffName=="Image") + { + if(mat!=null) + if(outputTexture) + { + Graphics.Blit(mainTex, outputTexture, mat); + // default blit of screen - no effect + Graphics.Blit(src, dest); + } + else + Graphics.Blit(mainTex, dest, mat); + } + else + { + if(mat!=null) Graphics.Blit(mainTex, buffers[buffName], mat); + } + } + } + + } + /*public void OnPostRender() { + }*/ + +} +} \ No newline at end of file diff --git a/Runtime/OilPainting/OilPaintingEffect.cs.meta b/Runtime/OilPainting/OilPaintingEffect.cs.meta new file mode 100644 index 0000000..4e3b8c7 --- /dev/null +++ b/Runtime/OilPainting/OilPaintingEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91a9cabf19a634d2fac557d213b89a59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/OilPainting/Readme.md b/Runtime/OilPainting/Readme.md new file mode 100644 index 0000000..debc6d1 --- /dev/null +++ b/Runtime/OilPainting/Readme.md @@ -0,0 +1,97 @@ +# Oil Painting - Unity3D Image Effect +#### (c) 2018 by [flockaroo](http://www.flockaroo.at) (Florian Berger) - email: + +****** + +### How to use + +Select your camera node and then simply add "OilPaintingEffect" script to camera components (can be found in Assets/flockaroo/OilPainting/). +You can drag/drop it to there or choose it from the menu (Component/Scripts/Flockaroo/OilPainting). + +![How to use - Image](/home/floh/floh/projects/unity/Unity_OilPainting/Assets/flockaroo/OilPainting/howto.png){ width="100%" } + +__Warning!!__ The subfolder "flockaroo_[effect name]" in "Resources" is needed by the effect script for unique identification of files and should not be removed or renamed. + +
+ +### Parameters + +The shader provides the following parameters: + +#### Input/Output + | Parameter | function + |-----------------|-------------- + | Input Texture | take this texture as input instead of the camera + | Render To Texture | render to texture instead of screen + | Output Texture | texture being rendered to if above is checked + | Output Mipmap | generate mipmap for output texture + +#### Main faders + | Parameter | function + |-----------------|-------------- + | Effect Fade | 0 = effect image ... 1 = original content + | Pan Fade | 0 = effect image ... 1 = original content - pan from left to right + +#### Source + | Parameter | function + |-----------------|-------------- + | Src Bright | adjust brightness of the content before applying the effect + | Src Contrast | adjust contrast of the content before applying the effect + | Src Color | adjust color intensity of the content before applying the effect + | Src Blur | blur the content before applying effect (only works from Unity-5.5 upwards) + + +#### Effect + | Parameter | function + |-----------------|-------------- + | Brush Detail | detail of the brush strokes + | Brush Fill | how much the brush strokes fill the screen area + | Num Strokes | number of strokes to be drawn + | LayerScale | lower number gives less different scales of strokes + | Canvas | roughness of canvas (bumpyness in the brush strokes) + | Flicker Freq | controls the frequency of the flickering (flickers/sec) + | Flicker Strength| makes the stroke position vary from frame to frame + | Light Ang | angle of light in screen plane [degrees] 0..360 + | Light Offs | angle of light to screen plane normal [degrees] 0..90 + | Paint Diff | diffuse lighting of paint strokes + | Paint Spec | specular reflections of paint strokes + | Paint Shiny | shininess of paint strokes + | Color Spread | adds some color variance between different strokes + | Screen FOV | field of view of screen in degrees (affects specular reflection) + | Stroke Ang | rotate strokes relative to gradient (e.g. 90 degree gives a very fuzzy look) + | Stroke Bend | -1.0 bend towards dark content, +1.0 bend towards bright content (e.g. for clouds) + | Stroke Dir | swaps front and back of stroke while maintaining its curve + | Stroke Contour | harder contour of strokes - gives a slight color blob at the start of the stroke + | Multi Stroke | if you enter 6 here you get 6*6 = 36 different strokes + | Stroke Seed | seed for randomly generated strokes + | Vignette | darkening the window border + | Canvas Bg | strength of background canvas pattern + | Canvas Tint | color tint of background + +##### Some Hints: +Lower Values of "Brush Fill", "Brush Detail", "Layer Scale" and "Num Strokes" give a sketchier look.
+A negative "Stroke Bend" would be best for images with clouds (bending the white strokes around the cloud shape), +whereas a positive value is more usful if you have dark ojects painted on a bright background.
+A "Screen FOV" of makes a specular with contant light/eye angles, as if viewer and light are far away from the image. +the bigger you make this angle the more you get a localized hilight on the image plane.
+If "Multi Stroke" is 0 or 1 then all strokes look the same (apart from their size), if on very plain areas the similarity is too obvious to the eye you can use bigger values so you get a diversity of different stroke shapes.
+ + + +#### Other + | Parameter | function + |-----------------|-------------- + | Flip Y | image Y flip + | Geom Flip Y | Y-flip of effect-internal geometry (use this if "Effect Fade" and "Pan Fade" wont work properly) + +##### concerning "Flip Y" and "Geom Flip Y": +The screen coordinates of unity are a bit mysterious. even more when working on different platforms. The Y-coordinate seems to be flipped between versions even on the same system, and also flipped depending on the system. + +So for "Flip Y" and "Geom Flip Y" follow these rules: + +If you have the source ("Effect Fade" to 1) flipped and the effect correct, just check "Geom Flip Y". + +If you have the source correct and the effect flipped, check both "Geom Flip Y" and "Flip Y". + +If both are equally flipped just check "Flip Y". + diff --git a/Runtime/OilPainting/Readme.md.meta b/Runtime/OilPainting/Readme.md.meta new file mode 100644 index 0000000..75c48c0 --- /dev/null +++ b/Runtime/OilPainting/Readme.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 469f9859058084e1ebd8b6aecd11632e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/OilPainting/Readme.pdf b/Runtime/OilPainting/Readme.pdf new file mode 100644 index 0000000..9f27267 Binary files /dev/null and b/Runtime/OilPainting/Readme.pdf differ diff --git a/Runtime/OilPainting/Readme.pdf.meta b/Runtime/OilPainting/Readme.pdf.meta new file mode 100644 index 0000000..f94bc5f --- /dev/null +++ b/Runtime/OilPainting/Readme.pdf.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7e900392d8b7149818271f0970952727 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/OilPainting/howto.png b/Runtime/OilPainting/howto.png new file mode 100644 index 0000000..83b5d26 Binary files /dev/null and b/Runtime/OilPainting/howto.png differ diff --git a/Runtime/OilPainting/howto.png.meta b/Runtime/OilPainting/howto.png.meta new file mode 100644 index 0000000..190781d --- /dev/null +++ b/Runtime/OilPainting/howto.png.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 053a9dbef784240a89a1492e08ba2ab9 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 7 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/UltraCombos.Flockaroo.asmdef b/Runtime/UltraCombos.Flockaroo.asmdef new file mode 100644 index 0000000..bdc1fe6 --- /dev/null +++ b/Runtime/UltraCombos.Flockaroo.asmdef @@ -0,0 +1,12 @@ +{ + "name": "UltraCombos.Flockaroo.Runtime", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/Runtime/UltraCombos.Flockaroo.asmdef.meta b/Runtime/UltraCombos.Flockaroo.asmdef.meta new file mode 100644 index 0000000..c71349f --- /dev/null +++ b/Runtime/UltraCombos.Flockaroo.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b7367eeab1c7d8c49ba5a96fa8ab3fe8 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests.meta b/Tests.meta new file mode 100644 index 0000000..9b826bf --- /dev/null +++ b/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1303dfdfb632cb94d89824ec7f131b4f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils.meta b/Tests/ColoredPencils.meta new file mode 100644 index 0000000..41cdabc --- /dev/null +++ b/Tests/ColoredPencils.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9c31e70baf74a3438577ce5c2fa410f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils/DemoScene.meta b/Tests/ColoredPencils/DemoScene.meta new file mode 100644 index 0000000..8f69a10 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f8424cdf21e5e4743aef8887ff6da914 +folderAsset: yes +timeCreated: 1531243294 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils/DemoScene/DemoScene.unity b/Tests/ColoredPencils/DemoScene/DemoScene.unity new file mode 100644 index 0000000..9603bfc --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/DemoScene.unity @@ -0,0 +1,607 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: .25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogMode: 3 + m_FogDensity: .00999999978 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} + m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} + m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: .5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!127 &3 +LevelGameManager: + m_ObjectHideFlags: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_LightmapSnapshot: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: .5 + agentHeight: 2 + agentSlope: 45 + agentClimb: .400000006 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: .166666672 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &124582537 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 124582538} + - 33: {fileID: 124582541} + - 136: {fileID: 124582540} + - 23: {fileID: 124582539} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &124582538 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 3.31999993, y: 2.78999996, z: 3.17000008} + m_LocalScale: {x: 1.9904418, y: 1.99044204, z: 1.99044204} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 3 +--- !u!23 &124582539 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: 9a131ad318d1c864f877dca7c51047c2, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!136 &124582540 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: .5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &124582541 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &261853471 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 261853472} + - 33: {fileID: 261853475} + - 135: {fileID: 261853474} + - 23: {fileID: 261853473} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &261853472 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: .150000006, y: 2.67000008, z: -4.11999989} + m_LocalScale: {x: 1.88985467, y: 1.88985395, z: 1.88985395} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 2 +--- !u!23 &261853473 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: 4074049c4e7e1984689e60e030adf2c7, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!135 &261853474 +SphereCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: .5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &261853475 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &378624258 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 378624259} + - 33: {fileID: 378624262} + - 64: {fileID: 378624261} + - 23: {fileID: 378624260} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &378624259 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 0 +--- !u!23 &378624260 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: 8c810c4fefa6ab3498f0aa0a420cee25, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!64 &378624261 +MeshCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Convex: 0 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &378624262 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &486745529 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 486745531} + - 108: {fileID: 486745530} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &486745530 +Light: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 486745529} + m_Enabled: 1 + serializedVersion: 6 + m_Type: 1 + m_Color: {r: 1, g: .956862748, b: .839215696, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_Strength: 1 + m_Bias: .0500000007 + m_NormalBias: .400000006 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_BounceIntensity: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 + m_AreaSize: {x: 1, y: 1} +--- !u!4 &486745531 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 486745529} + m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 +--- !u!1 &556234650 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 556234651} + - 114: {fileID: 556234652} + m_Layer: 0 + m_Name: uber1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &556234651 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 556234650} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 378624259} + - {fileID: 1725950362} + - {fileID: 261853472} + - {fileID: 124582538} + m_Father: {fileID: 0} + m_RootOrder: 2 +--- !u!114 &556234652 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 556234650} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c8a8ca4c86123cb49bc2697d2de0de1e, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &991725394 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 991725400} + - 20: {fileID: 991725399} + - 92: {fileID: 991725398} + - 124: {fileID: 991725397} + - 81: {fileID: 991725396} + - 114: {fileID: 991725395} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &991725395 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 79621082da8ba124eba3da9eba119a06, type: 3} + m_Name: + m_EditorClassIdentifier: + inputTexture: {fileID: 0} + renderToTexture: 0 + outputTexture: {fileID: 0} + outputMipmap: 0 + fade: 0 + panFade: 0 + brightness: 1 + contrast: 1 + color: 1 + shaderMethod: 0 + outlines: 1 + hatches: 1 + outlineError: 1 + flicker: .300000012 + flickerFreq: 10 + fixedHatchDir: 0 + hatchScale: 1 + hatchLength: 10 + mipLevel: 0 + vignetting: 1 + contentVignetting: 0 + paperTint: {r: 1, g: .970000029, b: .850000024, a: 1} + paperRoughness: 1 + paperTex: {fileID: 0} + flipY: 0 +--- !u!81 &991725396 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 +--- !u!124 &991725397 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 +--- !u!92 &991725398 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 +--- !u!20 &991725399 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: .300000012 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: .0219999999 + m_StereoMirrorMode: 0 +--- !u!4 &991725400 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_LocalRotation: {x: .00242051878, y: 0, z: 0, w: .999997079} + m_LocalPosition: {x: 0, y: 2, z: -9.85999966} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!1 &1725950358 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1725950362} + - 33: {fileID: 1725950361} + - 65: {fileID: 1725950360} + - 23: {fileID: 1725950359} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1725950359 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: b99c56aa1f07add48bee395d7c445161, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!65 &1725950360 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1725950361 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1725950362 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -3.04999995, y: 1.91999996, z: 2.92000008} + m_LocalScale: {x: 2.21319747, y: 2.21319795, z: 2.21319795} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 1 diff --git a/Tests/ColoredPencils/DemoScene/DemoScene.unity.meta b/Tests/ColoredPencils/DemoScene/DemoScene.unity.meta new file mode 100644 index 0000000..999ed73 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/DemoScene.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5abe80dfba13d574d88fab89dfa6a420 +timeCreated: 1529633512 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils/DemoScene/New Material 1.mat b/Tests/ColoredPencils/DemoScene/New Material 1.mat new file mode 100644 index 0000000..fee56d1 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material 1.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material 1 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: 0, g: .296551704, b: 1, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/ColoredPencils/DemoScene/New Material 1.mat.meta b/Tests/ColoredPencils/DemoScene/New Material 1.mat.meta new file mode 100644 index 0000000..e5f68a3 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material 1.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b99c56aa1f07add48bee395d7c445161 +timeCreated: 1529654577 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils/DemoScene/New Material 2.mat b/Tests/ColoredPencils/DemoScene/New Material 2.mat new file mode 100644 index 0000000..fc1fb15 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material 2.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material 2 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: 1, g: .694058537, b: .154411793, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/ColoredPencils/DemoScene/New Material 2.mat.meta b/Tests/ColoredPencils/DemoScene/New Material 2.mat.meta new file mode 100644 index 0000000..f121c58 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material 2.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4074049c4e7e1984689e60e030adf2c7 +timeCreated: 1529654586 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils/DemoScene/New Material 3.mat b/Tests/ColoredPencils/DemoScene/New Material 3.mat new file mode 100644 index 0000000..8cf49e1 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material 3.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material 3 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: 1, g: .389705896, b: .907403529, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/ColoredPencils/DemoScene/New Material 3.mat.meta b/Tests/ColoredPencils/DemoScene/New Material 3.mat.meta new file mode 100644 index 0000000..18dacbd --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material 3.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a131ad318d1c864f877dca7c51047c2 +timeCreated: 1529654595 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils/DemoScene/New Material.mat b/Tests/ColoredPencils/DemoScene/New Material.mat new file mode 100644 index 0000000..81f9a22 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: .352941185, g: 1, b: .811764717, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/ColoredPencils/DemoScene/New Material.mat.meta b/Tests/ColoredPencils/DemoScene/New Material.mat.meta new file mode 100644 index 0000000..f4bbf3f --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/New Material.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c810c4fefa6ab3498f0aa0a420cee25 +timeCreated: 1529654573 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/ColoredPencils/DemoScene/youSpinMeRiseRound_ColoredPencils.cs b/Tests/ColoredPencils/DemoScene/youSpinMeRiseRound_ColoredPencils.cs new file mode 100644 index 0000000..0d17651 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/youSpinMeRiseRound_ColoredPencils.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class youSpinMeRiseRound_ColoredPencils : MonoBehaviour { + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + transform.Rotate(Vector3.up, 50*Time.deltaTime); + } +} diff --git a/Tests/ColoredPencils/DemoScene/youSpinMeRiseRound_ColoredPencils.cs.meta b/Tests/ColoredPencils/DemoScene/youSpinMeRiseRound_ColoredPencils.cs.meta new file mode 100644 index 0000000..dbade81 --- /dev/null +++ b/Tests/ColoredPencils/DemoScene/youSpinMeRiseRound_ColoredPencils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c8a8ca4c86123cb49bc2697d2de0de1e +timeCreated: 1546809074 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting.meta b/Tests/OilPainting.meta new file mode 100644 index 0000000..c79bf26 --- /dev/null +++ b/Tests/OilPainting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5928b28a2d3ab69468723d76c64e4908 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting/DemoScene.meta b/Tests/OilPainting/DemoScene.meta new file mode 100644 index 0000000..7dec28f --- /dev/null +++ b/Tests/OilPainting/DemoScene.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 06e177f4559b14cf49d3f0adb18940e8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting/DemoScene/DemoScene.unity b/Tests/OilPainting/DemoScene/DemoScene.unity new file mode 100644 index 0000000..bbe7384 --- /dev/null +++ b/Tests/OilPainting/DemoScene/DemoScene.unity @@ -0,0 +1,607 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: .25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogMode: 3 + m_FogDensity: .00999999978 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} + m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} + m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: .5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!127 &3 +LevelGameManager: + m_ObjectHideFlags: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_LightmapSnapshot: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: .5 + agentHeight: 2 + agentSlope: 45 + agentClimb: .400000006 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: .166666672 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &124582537 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 124582538} + - 33: {fileID: 124582541} + - 136: {fileID: 124582540} + - 23: {fileID: 124582539} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &124582538 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 3.31999993, y: 2.78999996, z: 3.17000008} + m_LocalScale: {x: 1.9904418, y: 1.99044204, z: 1.99044204} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 3 +--- !u!23 &124582539 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: 9e1b302554cc7b741810c43ec96d4bf3, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!136 &124582540 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: .5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &124582541 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 124582537} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &261853471 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 261853472} + - 33: {fileID: 261853475} + - 135: {fileID: 261853474} + - 23: {fileID: 261853473} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &261853472 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: .150000006, y: 2.67000008, z: -4.11999989} + m_LocalScale: {x: 1.88985467, y: 1.88985395, z: 1.88985395} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 2 +--- !u!23 &261853473 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: 70c29e2b5f70dde4a822ced9affdf16a, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!135 &261853474 +SphereCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: .5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &261853475 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 261853471} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &378624258 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 378624259} + - 33: {fileID: 378624262} + - 64: {fileID: 378624261} + - 23: {fileID: 378624260} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &378624259 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 0 +--- !u!23 &378624260 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: aa27b368bf93a104585160b830fed08a, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!64 &378624261 +MeshCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Convex: 0 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &378624262 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 378624258} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &486745529 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 486745531} + - 108: {fileID: 486745530} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &486745530 +Light: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 486745529} + m_Enabled: 1 + serializedVersion: 6 + m_Type: 1 + m_Color: {r: 1, g: .956862748, b: .839215696, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_Strength: 1 + m_Bias: .0500000007 + m_NormalBias: .400000006 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_BounceIntensity: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 + m_AreaSize: {x: 1, y: 1} +--- !u!4 &486745531 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 486745529} + m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 +--- !u!1 &556234650 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 556234651} + - 114: {fileID: 556234652} + m_Layer: 0 + m_Name: uber1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &556234651 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 556234650} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 378624259} + - {fileID: 1725950362} + - {fileID: 261853472} + - {fileID: 124582538} + m_Father: {fileID: 0} + m_RootOrder: 2 +--- !u!114 &556234652 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 556234650} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8778bdd87f1849938600bd5f8b2fe0b, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &991725394 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 991725400} + - 20: {fileID: 991725399} + - 92: {fileID: 991725398} + - 124: {fileID: 991725397} + - 81: {fileID: 991725396} + - 114: {fileID: 991725395} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &991725395 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 91a9cabf19a634d2fac557d213b89a59, type: 3} + m_Name: + m_EditorClassIdentifier: + EffectFade: 0 + PanFade: 0 + SrcBright: 1 + SrcContrast: 1.39999998 + SrcBlur: 0 + BrushDetail: .100000001 + BrushFill: .5 + NumStrokes: 32768 + LayerScale: .800000012 + Canvas: .400000006 + FlickerStrength: 0 + LightAng: 135 + LightOffs: 60 + PaintDiff: .150000006 + PaintSpec: .150000006 + PaintShiny: .5 + ScreenFOV: 0 + StrokeAng: 0 + StrokeBend: -1 + StrokeDir: 0 + StrokeContour: 1 + MultiStroke: 6 + strokeSeed: 10 + Vignette: 1 + flipY: 0 +--- !u!81 &991725396 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 +--- !u!124 &991725397 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 +--- !u!92 &991725398 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 +--- !u!20 &991725399 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: .300000012 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: .0219999999 + m_StereoMirrorMode: 0 +--- !u!4 &991725400 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 991725394} + m_LocalRotation: {x: .00242051878, y: 0, z: 0, w: .999997079} + m_LocalPosition: {x: 0, y: 2, z: -9.85999966} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!1 &1725950358 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1725950362} + - 33: {fileID: 1725950361} + - 65: {fileID: 1725950360} + - 23: {fileID: 1725950359} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1725950359 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 2100000, guid: 651ed8109c496064e8f315643f67b3c7, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_ImportantGI: 0 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!65 &1725950360 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1725950361 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1725950362 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1725950358} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -3.04999995, y: 1.91999996, z: 2.92000008} + m_LocalScale: {x: 2.21319747, y: 2.21319795, z: 2.21319795} + m_Children: [] + m_Father: {fileID: 556234651} + m_RootOrder: 1 diff --git a/Tests/OilPainting/DemoScene/DemoScene.unity.meta b/Tests/OilPainting/DemoScene/DemoScene.unity.meta new file mode 100644 index 0000000..0ba10a3 --- /dev/null +++ b/Tests/OilPainting/DemoScene/DemoScene.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 011dbb86a988d9440ba31725043d8a19 +timeCreated: 1546619418 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting/DemoScene/New Material 1.mat b/Tests/OilPainting/DemoScene/New Material 1.mat new file mode 100644 index 0000000..fee56d1 --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material 1.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material 1 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: 0, g: .296551704, b: 1, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/OilPainting/DemoScene/New Material 1.mat.meta b/Tests/OilPainting/DemoScene/New Material 1.mat.meta new file mode 100644 index 0000000..1cad54e --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material 1.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e1b302554cc7b741810c43ec96d4bf3 +timeCreated: 1546619418 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting/DemoScene/New Material 2.mat b/Tests/OilPainting/DemoScene/New Material 2.mat new file mode 100644 index 0000000..fc1fb15 --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material 2.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material 2 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: 1, g: .694058537, b: .154411793, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/OilPainting/DemoScene/New Material 2.mat.meta b/Tests/OilPainting/DemoScene/New Material 2.mat.meta new file mode 100644 index 0000000..2f517e2 --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material 2.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70c29e2b5f70dde4a822ced9affdf16a +timeCreated: 1546619418 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting/DemoScene/New Material 3.mat b/Tests/OilPainting/DemoScene/New Material 3.mat new file mode 100644 index 0000000..8cf49e1 --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material 3.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material 3 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: 1, g: .389705896, b: .907403529, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/OilPainting/DemoScene/New Material 3.mat.meta b/Tests/OilPainting/DemoScene/New Material 3.mat.meta new file mode 100644 index 0000000..caf0260 --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material 3.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 651ed8109c496064e8f315643f67b3c7 +timeCreated: 1546619418 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting/DemoScene/New Material.mat b/Tests/OilPainting/DemoScene/New Material.mat new file mode 100644 index 0000000..81f9a22 --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material.mat @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: New Material + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 0} + data: + first: + name: _Color + second: {r: .352941185, g: 1, b: .811764717, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tests/OilPainting/DemoScene/New Material.mat.meta b/Tests/OilPainting/DemoScene/New Material.mat.meta new file mode 100644 index 0000000..f774bc1 --- /dev/null +++ b/Tests/OilPainting/DemoScene/New Material.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa27b368bf93a104585160b830fed08a +timeCreated: 1546619418 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/OilPainting/DemoScene/youSpinMeRiseRound_OilPainting.cs b/Tests/OilPainting/DemoScene/youSpinMeRiseRound_OilPainting.cs new file mode 100644 index 0000000..3388ff6 --- /dev/null +++ b/Tests/OilPainting/DemoScene/youSpinMeRiseRound_OilPainting.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class youSpinMeRiseRound_OilPainting : MonoBehaviour { + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + transform.Rotate(Vector3.up, 50*Time.deltaTime); + } +} diff --git a/Tests/OilPainting/DemoScene/youSpinMeRiseRound_OilPainting.cs.meta b/Tests/OilPainting/DemoScene/youSpinMeRiseRound_OilPainting.cs.meta new file mode 100644 index 0000000..170ba86 --- /dev/null +++ b/Tests/OilPainting/DemoScene/youSpinMeRiseRound_OilPainting.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e8778bdd87f1849938600bd5f8b2fe0b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..3262856 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "name": "com.ultracombos.flockaroo", + "displayName": "flockaroo Filter", + "version": "0.0.1", + "unity": "2018.1", + "description": "flockaroo Filter (OilPainting / ColoredPencils) for Unity.", + "dependencies": { } +} diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..2864d3b --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 847e2adc0c05288438097a491486b46b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: