changes
parent
f98eb96584
commit
2816ca2aff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@ -1,93 +1,81 @@
|
|||||||
Shader "QO/Effect/Mosaic" {
|
Shader "QO/Effect/Mosaic"
|
||||||
Properties {
|
{
|
||||||
_tex0 ("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
Properties
|
||||||
_tex1 ("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
{
|
||||||
_X ("x pixels", Float) = 0
|
_tex0("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
||||||
_Y ("y pixels", Float) = 0
|
_tex1("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
||||||
_MX ("min x pixels", Float) = 16
|
_X("x pixels", Float) = 0
|
||||||
_MY ("min y pixels", Float) = 9
|
_Y("y pixels", Float) = 0
|
||||||
_time ("time rate", Range(0,1)) = 0
|
_MX("min x pixels", Float) = 16
|
||||||
}
|
_MY("min y pixels", Float) = 9
|
||||||
SubShader {
|
_time("time rate", Range(0,1)) = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
LOD 200
|
LOD 200
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
Tags { "QUEUE" = "Transparent" "RenderType" = "Transparent" }
|
||||||
Pass {
|
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
Blend SrcAlpha OneMinusSrcAlpha
|
||||||
Program "vp" {
|
Lighting Off
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
ZTest Always ZWrite Off
|
||||||
|
Fog { Mode off }
|
||||||
|
|
||||||
#ifdef VERTEX
|
|
||||||
|
|
||||||
varying mediump vec4 xlv_TEXCOORD0;
|
CGPROGRAM
|
||||||
varying lowp vec4 xlv_COLOR0;
|
#pragma vertex vert_img
|
||||||
uniform highp mat4 glstate_matrix_mvp;
|
#pragma fragment frag
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
#pragma fragmentoption ARB_precision_hint_fastest
|
||||||
attribute vec4 _glesVertex;
|
#include "UnityCG.cginc"
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
gl_Position = (glstate_matrix_mvp * _glesVertex);
|
|
||||||
xlv_COLOR0 = vec4(1.0, 1.0, 1.0, 1.0);
|
|
||||||
xlv_TEXCOORD0 = _glesMultiTexCoord0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
uniform sampler2D _tex0;
|
||||||
|
uniform sampler2D _tex1;
|
||||||
|
uniform float _X;
|
||||||
|
uniform float _Y;
|
||||||
|
uniform float _MX;
|
||||||
|
uniform float _MY;
|
||||||
|
uniform float _time;
|
||||||
|
|
||||||
#endif
|
|
||||||
#ifdef FRAGMENT
|
|
||||||
|
|
||||||
varying mediump vec4 xlv_TEXCOORD0;
|
fixed4 frag(v2f_img i) :COLOR
|
||||||
uniform mediump float _time;
|
{
|
||||||
uniform mediump float _MY;
|
//Setup for UV
|
||||||
uniform mediump float _MX;
|
float tmpvar_1 = (1.0 - sin(mul(_time,3.14)));
|
||||||
uniform mediump float _Y;
|
float tmpvar_2 = mul(tmpvar_1, _X) + _MX;
|
||||||
uniform mediump float _X;
|
float tmpvar_3 = mul(tmpvar_1, _Y) + _MY;
|
||||||
uniform sampler2D _tex1;
|
float tmpvar_4_x = float(max(0.0, min(1.0, floor(mul(i.uv.x, tmpvar_2)) / tmpvar_2)));
|
||||||
uniform sampler2D _tex0;
|
float tmpvar_4_y = float(max(0.0, min(1.0, floor(mul(i.uv.y, tmpvar_3)) / tmpvar_3)));
|
||||||
void main ()
|
float2 tmpvar_4 = float2(tmpvar_4_x, tmpvar_4_y);
|
||||||
{
|
|
||||||
mediump float tmpvar_1;
|
|
||||||
tmpvar_1 = (1.0 - sin((_time * 3.14)));
|
|
||||||
mediump float tmpvar_2;
|
|
||||||
tmpvar_2 = ((tmpvar_1 * _X) + _MX);
|
|
||||||
mediump float tmpvar_3;
|
|
||||||
tmpvar_3 = ((tmpvar_1 * _Y) + _MY);
|
|
||||||
mediump vec2 tmpvar_4;
|
|
||||||
tmpvar_4.x = max (0.0, min (1.0, (floor((xlv_TEXCOORD0.x * tmpvar_2)) / tmpvar_2)));
|
|
||||||
tmpvar_4.y = max (0.0, min (1.0, (floor((xlv_TEXCOORD0.y * tmpvar_3)) / tmpvar_3)));
|
|
||||||
lowp vec4 tmpvar_5;
|
|
||||||
tmpvar_5 = texture2D (_tex0, tmpvar_4);
|
|
||||||
mediump float tmpvar_6;
|
|
||||||
mediump float t_7;
|
|
||||||
t_7 = max (min ((((1.0 - _time) - 0.45) / 0.11), 1.0), 0.0);
|
|
||||||
tmpvar_6 = (t_7 * (t_7 * (3.0 - (2.0 * t_7))));
|
|
||||||
mediump vec4 tmpvar_8;
|
|
||||||
tmpvar_8.xyz = tmpvar_5.xyz;
|
|
||||||
tmpvar_8.w = tmpvar_6;
|
|
||||||
lowp vec4 tmpvar_9;
|
|
||||||
tmpvar_9 = texture2D (_tex1, tmpvar_4);
|
|
||||||
mediump vec4 tmpvar_10;
|
|
||||||
tmpvar_10.xyz = tmpvar_9.xyz;
|
|
||||||
tmpvar_10.w = (1.0 - tmpvar_6);
|
|
||||||
mediump vec4 tmpvar_11;
|
|
||||||
tmpvar_11.xyz = ((tmpvar_8.xyz * tmpvar_6) + (tmpvar_10.xyz * tmpvar_10.w));
|
|
||||||
tmpvar_11.w = (tmpvar_6 + tmpvar_10.w);
|
|
||||||
gl_FragData[0] = tmpvar_11;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//Textures
|
||||||
|
float4 tmpvar_5 = tex2D(_tex0, tmpvar_4);
|
||||||
|
float4 tmpvar_9 = tex2D(_tex1, tmpvar_4);
|
||||||
|
|
||||||
|
//Setup for 6
|
||||||
|
float t_7 = max(min((((1 - _time) - 0.45) / 0.11), 1.0), 0.0);
|
||||||
|
float tmpvar_6 = mul(t_7 , mul(t_7 , (3.0 - mul(2.0 , t_7))));
|
||||||
|
|
||||||
#endif"
|
//Setup for 8
|
||||||
}
|
float4 tmpvar_8 = float4(tmpvar_5.x, tmpvar_5.y, tmpvar_5.z, tmpvar_6);
|
||||||
}
|
|
||||||
Program "fp" {
|
//Setup for 10
|
||||||
SubProgram "gles " {
|
float4 tmpvar_10 = float4(tmpvar_9.x, tmpvar_9.y, tmpvar_9.z, (1.0 - tmpvar_6));
|
||||||
"!!GLES"
|
|
||||||
}
|
//Final output
|
||||||
}
|
float3 tmpvar_11_xyz = ((float3(tmpvar_8.x, tmpvar_8.y, tmpvar_8.z) * tmpvar_6) + (float3(tmpvar_10.x, tmpvar_10.y, tmpvar_10.z) * tmpvar_10.w));
|
||||||
|
float tmpvar_11_w = (tmpvar_6 + tmpvar_10.w);
|
||||||
|
float4 tmpvar_11 = float4(tmpvar_11_xyz.x, tmpvar_11_xyz.y, tmpvar_11_xyz.z, tmpvar_11_w);
|
||||||
|
|
||||||
|
//Return output
|
||||||
|
return tmpvar_11;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Fallback "VertexLit"
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FallBack off
|
||||||
}
|
}
|
||||||
@ -1,85 +0,0 @@
|
|||||||
Shader "QO/Effect/CrossFade1" {
|
|
||||||
Properties {
|
|
||||||
_tex0 ("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
|
||||||
_tex1 ("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
|
||||||
_time ("_time : TimeRate", Range(0,1)) = 0
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
LOD 200
|
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
|
||||||
Pass {
|
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
|
||||||
Program "vp" {
|
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERTEX
|
|
||||||
|
|
||||||
varying lowp vec2 xlv_TEXCOORD0;
|
|
||||||
varying lowp vec4 xlv_COLOR0;
|
|
||||||
uniform highp mat4 glstate_matrix_mvp;
|
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
|
||||||
attribute vec4 _glesVertex;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
lowp vec2 tmpvar_1;
|
|
||||||
highp vec2 tmpvar_2;
|
|
||||||
tmpvar_2 = _glesMultiTexCoord0.xy;
|
|
||||||
tmpvar_1 = tmpvar_2;
|
|
||||||
gl_Position = (glstate_matrix_mvp * _glesVertex);
|
|
||||||
xlv_COLOR0 = vec4(1.0, 1.0, 1.0, 1.0);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#ifdef FRAGMENT
|
|
||||||
|
|
||||||
varying lowp vec2 xlv_TEXCOORD0;
|
|
||||||
uniform lowp float _time;
|
|
||||||
uniform sampler2D _tex1;
|
|
||||||
uniform sampler2D _tex0;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
mediump vec4 t0_1;
|
|
||||||
highp float alpha_2;
|
|
||||||
mediump vec4 toImage_3;
|
|
||||||
mediump vec4 fromImage_4;
|
|
||||||
lowp vec4 tmpvar_5;
|
|
||||||
tmpvar_5 = texture2D (_tex0, xlv_TEXCOORD0);
|
|
||||||
fromImage_4 = tmpvar_5;
|
|
||||||
lowp vec4 tmpvar_6;
|
|
||||||
tmpvar_6 = texture2D (_tex1, xlv_TEXCOORD0);
|
|
||||||
toImage_3 = tmpvar_6;
|
|
||||||
lowp float tmpvar_7;
|
|
||||||
tmpvar_7 = min (1.0, max (0.0, _time));
|
|
||||||
mediump float tmpvar_8;
|
|
||||||
tmpvar_8 = (fromImage_4.w * (1.0 - tmpvar_7));
|
|
||||||
alpha_2 = tmpvar_8;
|
|
||||||
highp vec4 tmpvar_9;
|
|
||||||
tmpvar_9.xyz = (fromImage_4.xyz * alpha_2);
|
|
||||||
tmpvar_9.w = alpha_2;
|
|
||||||
t0_1 = tmpvar_9;
|
|
||||||
mediump vec4 tmpvar_10;
|
|
||||||
tmpvar_10.w = 1.0;
|
|
||||||
tmpvar_10.xyz = (t0_1.xyz + (toImage_3.xyz * (1.0 - t0_1.w)));
|
|
||||||
gl_FragData[0] = tmpvar_10;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Program "fp" {
|
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Fallback "VertexLit"
|
|
||||||
}
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
Shader "QO/Effect/Transition1" {
|
|
||||||
Properties {
|
|
||||||
_tex0 ("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
|
||||||
_tex1 ("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
|
||||||
_tex2 ("_tex2 : Pattern (GrayScale)", 2D) = "white" {}
|
|
||||||
_time ("_time : TimeRate", Range(0,1)) = 0
|
|
||||||
_grad ("_grad : Gradation Level", Float) = 0.1
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
LOD 200
|
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
|
||||||
Pass {
|
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
|
||||||
Program "vp" {
|
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERTEX
|
|
||||||
|
|
||||||
varying lowp vec2 xlv_TEXCOORD0;
|
|
||||||
varying lowp vec4 xlv_COLOR0;
|
|
||||||
uniform highp mat4 glstate_matrix_mvp;
|
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
|
||||||
attribute vec4 _glesVertex;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
lowp vec2 tmpvar_1;
|
|
||||||
highp vec2 tmpvar_2;
|
|
||||||
tmpvar_2 = _glesMultiTexCoord0.xy;
|
|
||||||
tmpvar_1 = tmpvar_2;
|
|
||||||
gl_Position = (glstate_matrix_mvp * _glesVertex);
|
|
||||||
xlv_COLOR0 = vec4(1.0, 1.0, 1.0, 1.0);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#ifdef FRAGMENT
|
|
||||||
|
|
||||||
varying lowp vec2 xlv_TEXCOORD0;
|
|
||||||
uniform lowp float _grad;
|
|
||||||
uniform lowp float _time;
|
|
||||||
uniform sampler2D _tex2;
|
|
||||||
uniform sampler2D _tex1;
|
|
||||||
uniform sampler2D _tex0;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
mediump float grad_1;
|
|
||||||
mediump vec4 toImage_2;
|
|
||||||
mediump vec4 fromImage_3;
|
|
||||||
mediump vec3 trans_4;
|
|
||||||
lowp vec3 tmpvar_5;
|
|
||||||
tmpvar_5 = texture2D (_tex2, xlv_TEXCOORD0).xyz;
|
|
||||||
trans_4 = tmpvar_5;
|
|
||||||
lowp vec4 tmpvar_6;
|
|
||||||
tmpvar_6.w = 1.0;
|
|
||||||
tmpvar_6.xyz = texture2D (_tex0, xlv_TEXCOORD0).xyz;
|
|
||||||
fromImage_3 = tmpvar_6;
|
|
||||||
lowp vec4 tmpvar_7;
|
|
||||||
tmpvar_7.w = 1.0;
|
|
||||||
tmpvar_7.xyz = texture2D (_tex1, xlv_TEXCOORD0).xyz;
|
|
||||||
toImage_2 = tmpvar_7;
|
|
||||||
lowp float tmpvar_8;
|
|
||||||
tmpvar_8 = (_grad * 0.5);
|
|
||||||
grad_1 = tmpvar_8;
|
|
||||||
mediump float tmpvar_9;
|
|
||||||
tmpvar_9 = max (0.0, (trans_4.x - grad_1));
|
|
||||||
mediump float t_10;
|
|
||||||
t_10 = max (min (((_time - tmpvar_9) / (min (1.0, (trans_4.x + grad_1)) - tmpvar_9)), 1.0), 0.0);
|
|
||||||
mediump vec4 tmpvar_11;
|
|
||||||
tmpvar_11.xyz = toImage_2.xyz;
|
|
||||||
tmpvar_11.w = (toImage_2.w * (t_10 * (t_10 * (3.0 - (2.0 * t_10)))));
|
|
||||||
mediump vec4 tmpvar_12;
|
|
||||||
tmpvar_12.xyz = fromImage_3.xyz;
|
|
||||||
tmpvar_12.w = (1.0 - tmpvar_11.w);
|
|
||||||
mediump vec4 tmpvar_13;
|
|
||||||
tmpvar_13.xyz = ((toImage_2.xyz * tmpvar_11.w) + (fromImage_3.xyz * tmpvar_12.w));
|
|
||||||
tmpvar_13.w = (tmpvar_11.w + tmpvar_12.w);
|
|
||||||
gl_FragData[0] = tmpvar_13;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Program "fp" {
|
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Fallback "VertexLit"
|
|
||||||
}
|
|
||||||
@ -1,127 +1,90 @@
|
|||||||
Shader "QO/Effect/Ripple" {
|
Shader "QO/Effect/Ripple"
|
||||||
Properties {
|
{
|
||||||
_tex0 ("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
Properties
|
||||||
_tex1 ("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
{
|
||||||
_time ("_time : time rate", Range(0,1)) = 0
|
_tex0("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
||||||
_pow ("_pow : screen wave power", Float) = 2
|
_tex1("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
||||||
_w ("_w : ripple wave width", Float) = 1.5
|
_time("time rate", Range(0,1)) = 0
|
||||||
_h ("_h : ripple wave height", Float) = 5
|
_pow("_pow : screen wave power", Float) = 2
|
||||||
_speed ("_speed : ripple wave speed", Float) = 2
|
_w("_w : ripple wave width", Float) = 1.5
|
||||||
}
|
_h("_h : ripple wave height", Float) = 5
|
||||||
SubShader {
|
_speed("_speed : ripple wave speed", Float) = 2
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
LOD 200
|
LOD 200
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
Tags { "QUEUE" = "Transparent" "RenderType" = "Transparent" }
|
||||||
Pass {
|
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
Blend SrcAlpha OneMinusSrcAlpha
|
||||||
Program "vp" {
|
Lighting Off
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
ZTest Always ZWrite Off
|
||||||
|
Fog { Mode off }
|
||||||
|
|
||||||
#ifdef VERTEX
|
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
CGPROGRAM
|
||||||
varying lowp vec4 xlv_COLOR0;
|
#pragma vertex vert_img
|
||||||
uniform highp mat4 glstate_matrix_mvp;
|
#pragma fragment frag
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
#pragma fragmentoption ARB_precision_hint_fastest
|
||||||
attribute vec4 _glesVertex;
|
#include "UnityCG.cginc"
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
mediump vec2 tmpvar_1;
|
|
||||||
highp vec2 tmpvar_2;
|
|
||||||
tmpvar_2 = _glesMultiTexCoord0.xy;
|
|
||||||
tmpvar_1 = tmpvar_2;
|
|
||||||
gl_Position = (glstate_matrix_mvp * _glesVertex);
|
|
||||||
xlv_COLOR0 = vec4(1.0, 1.0, 1.0, 1.0);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
uniform sampler2D _tex0;
|
||||||
|
uniform sampler2D _tex1;
|
||||||
|
uniform float _time;
|
||||||
|
uniform float _w;
|
||||||
|
uniform float _h;
|
||||||
|
uniform float _pow;
|
||||||
|
uniform float _speed;
|
||||||
|
|
||||||
#endif
|
|
||||||
#ifdef FRAGMENT
|
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
|
||||||
uniform mediump float _speed;
|
|
||||||
uniform mediump float _w;
|
|
||||||
uniform mediump float _h;
|
|
||||||
uniform mediump float _pow;
|
|
||||||
uniform mediump float _time;
|
|
||||||
uniform sampler2D _tex1;
|
|
||||||
uniform sampler2D _tex0;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
lowp float check2_1;
|
|
||||||
lowp float check1_2;
|
|
||||||
mediump vec2 tmpvar_3;
|
|
||||||
tmpvar_3.x = (xlv_TEXCOORD0.x - 0.5);
|
|
||||||
tmpvar_3.y = ((xlv_TEXCOORD0.y - 0.5) * 0.5625);
|
|
||||||
mediump float tmpvar_4;
|
|
||||||
tmpvar_4 = (_time * _speed);
|
|
||||||
mediump float tmpvar_5;
|
|
||||||
tmpvar_5 = sqrt(dot (tmpvar_3, tmpvar_3));
|
|
||||||
mediump float tmpvar_6;
|
|
||||||
tmpvar_6 = (tmpvar_4 - (_w * 0.01));
|
|
||||||
mediump float tmpvar_7;
|
|
||||||
tmpvar_7 = ((_time - 0.25) * _speed);
|
|
||||||
mediump float tmpvar_8;
|
|
||||||
tmpvar_8 = sqrt(dot (tmpvar_3, tmpvar_3));
|
|
||||||
mediump float tmpvar_9;
|
|
||||||
tmpvar_9 = (tmpvar_7 - (_w * 0.01));
|
|
||||||
mediump float tmpvar_10;
|
|
||||||
tmpvar_10 = ((_time - 0.5) * _speed);
|
|
||||||
mediump float tmpvar_11;
|
|
||||||
tmpvar_11 = sqrt(dot (tmpvar_3, tmpvar_3));
|
|
||||||
mediump float tmpvar_12;
|
|
||||||
tmpvar_12 = (tmpvar_10 - (_w * 0.01));
|
|
||||||
mediump float tmpvar_13;
|
|
||||||
tmpvar_13 = ((_time - 0.75) * _speed);
|
|
||||||
mediump float tmpvar_14;
|
|
||||||
tmpvar_14 = sqrt(dot (tmpvar_3, tmpvar_3));
|
|
||||||
mediump float tmpvar_15;
|
|
||||||
tmpvar_15 = (tmpvar_13 - (_w * 0.01));
|
|
||||||
mediump float tmpvar_16;
|
|
||||||
tmpvar_16 = (1.0 - _time);
|
|
||||||
mediump vec2 tmpvar_17;
|
|
||||||
tmpvar_17 = ((((((tmpvar_3 * ((sin((((tmpvar_4 - tmpvar_5) / (tmpvar_4 - tmpvar_6)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_5 - tmpvar_6) >= 0.0)) + float(((tmpvar_4 - tmpvar_5) >= 0.0))) >= 2.0))) + ((tmpvar_3 * ((sin((((tmpvar_7 - tmpvar_8) / (tmpvar_7 - tmpvar_9)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_8 - tmpvar_9) >= 0.0)) + float(((tmpvar_7 - tmpvar_8) >= 0.0))) >= 2.0)))) + ((tmpvar_3 * ((sin((((tmpvar_10 - tmpvar_11) / (tmpvar_10 - tmpvar_12)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_11 - tmpvar_12) >= 0.0)) + float(((tmpvar_10 - tmpvar_11) >= 0.0))) >= 2.0)))) + ((tmpvar_3 * ((sin((((tmpvar_13 - tmpvar_14) / (tmpvar_13 - tmpvar_15)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_14 - tmpvar_15) >= 0.0)) + float(((tmpvar_13 - tmpvar_14) >= 0.0))) >= 2.0)))) * tmpvar_16);
|
|
||||||
mediump vec2 tmpvar_18;
|
|
||||||
tmpvar_18 = (xlv_TEXCOORD0 + (((tmpvar_3 * (sin((50.2654 * (sqrt(dot (tmpvar_3, tmpvar_3)) * _time))) * (_pow * 0.01))) * tmpvar_16) + tmpvar_17));
|
|
||||||
mediump float tmpvar_19;
|
|
||||||
tmpvar_19 = float((-0.01 >= (xlv_TEXCOORD0.y + tmpvar_17.y)));
|
|
||||||
check1_2 = tmpvar_19;
|
|
||||||
mediump float tmpvar_20;
|
|
||||||
tmpvar_20 = float((-0.01 >= (1.0 - (xlv_TEXCOORD0.y + tmpvar_17.y))));
|
|
||||||
check2_1 = tmpvar_20;
|
|
||||||
lowp float tmpvar_21;
|
|
||||||
tmpvar_21 = float((0.0 >= (check1_2 + check2_1)));
|
|
||||||
lowp vec4 tmpvar_22;
|
|
||||||
tmpvar_22 = texture2D (_tex0, tmpvar_18);
|
|
||||||
mediump vec4 tmpvar_23;
|
|
||||||
tmpvar_23.xyz = tmpvar_22.xyz;
|
|
||||||
tmpvar_23.w = (1.0 - _time);
|
|
||||||
lowp vec4 tmpvar_24;
|
|
||||||
tmpvar_24 = texture2D (_tex1, tmpvar_18);
|
|
||||||
mediump vec4 tmpvar_25;
|
|
||||||
tmpvar_25.xyz = tmpvar_24.xyz;
|
|
||||||
tmpvar_25.w = (1.0 - tmpvar_23.w);
|
|
||||||
mediump vec4 tmpvar_26;
|
|
||||||
tmpvar_26.xyz = (((tmpvar_23.xyz * tmpvar_23.w) + (tmpvar_25.xyz * tmpvar_25.w)) * tmpvar_21);
|
|
||||||
tmpvar_26.w = (tmpvar_23.w + tmpvar_25.w);
|
|
||||||
gl_FragData[0] = tmpvar_26;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fixed4 frag(v2f_img i) :COLOR
|
||||||
|
{
|
||||||
|
|
||||||
|
float2 tmpvar_3 = float2((i.uv.x - 0.5), ((i.uv.y - 0.5) * 0.5625));
|
||||||
|
|
||||||
#endif"
|
float tmpvar_4 = (_time * _speed);
|
||||||
}
|
float tmpvar_5 = sqrt(dot(tmpvar_3, tmpvar_3));
|
||||||
}
|
float tmpvar_6 = (tmpvar_4 - (_w * 0.01));
|
||||||
Program "fp" {
|
float tmpvar_7 = ((_time - 0.25) * _speed);
|
||||||
SubProgram "gles " {
|
float tmpvar_8 = sqrt(dot(tmpvar_3, tmpvar_3));
|
||||||
"!!GLES"
|
float tmpvar_9 = (tmpvar_7 - (_w * 0.01));
|
||||||
}
|
float tmpvar_10 = ((_time - 0.5) * _speed);
|
||||||
}
|
float tmpvar_11 = sqrt(dot(tmpvar_3, tmpvar_3));
|
||||||
|
float tmpvar_12 = (tmpvar_10 - (_w * 0.01));
|
||||||
|
float tmpvar_13 = ((_time - 0.75) * _speed);
|
||||||
|
float tmpvar_14 = sqrt(dot(tmpvar_3, tmpvar_3));
|
||||||
|
float tmpvar_15 = (tmpvar_13 - (_w * 0.01));
|
||||||
|
float tmpvar_16 = (1.0 - _time);
|
||||||
|
float2 tmpvar_17 = ((((((tmpvar_3 * ((sin((((tmpvar_4 - tmpvar_5) / (tmpvar_4 - tmpvar_6)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_5 - tmpvar_6) >= 0.0)) + float(((tmpvar_4 - tmpvar_5) >= 0.0))) >= 2.0))) + ((tmpvar_3 * ((sin((((tmpvar_7 - tmpvar_8) / (tmpvar_7 - tmpvar_9)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_8 - tmpvar_9) >= 0.0)) + float(((tmpvar_7 - tmpvar_8) >= 0.0))) >= 2.0)))) + ((tmpvar_3 * ((sin((((tmpvar_10 - tmpvar_11) / (tmpvar_10 - tmpvar_12)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_11 - tmpvar_12) >= 0.0)) + float(((tmpvar_10 - tmpvar_11) >= 0.0))) >= 2.0)))) + ((tmpvar_3 * ((sin((((tmpvar_13 - tmpvar_14) / (tmpvar_13 - tmpvar_15)) * 3.14159)) * _h) * 0.02)) * float(((float(((tmpvar_14 - tmpvar_15) >= 0.0)) + float(((tmpvar_13 - tmpvar_14) >= 0.0))) >= 2.0)))) * tmpvar_16);
|
||||||
|
float2 tmpvar_18 = (i.uv + (((tmpvar_3 * (sin((50.2654 * (sqrt(dot(tmpvar_3, tmpvar_3)) * _time))) * (_pow * 0.01))) * tmpvar_16) + tmpvar_17));
|
||||||
|
float tmpvar_19 = float((-0.01 >= (i.uv.y + tmpvar_17.y)));
|
||||||
|
float check1_2 = tmpvar_19;
|
||||||
|
float tmpvar_20 = float((-0.01 >= (1.0 - (i.uv.y + tmpvar_17.y))));
|
||||||
|
float check2_1 = tmpvar_20;
|
||||||
|
float tmpvar_21 = float((0.0 >= (check1_2 + check2_1)));
|
||||||
|
float4 tmpvar_22 = tex2D (_tex0, tmpvar_18);
|
||||||
|
|
||||||
|
float4 tmpvar_23 = float4(tmpvar_22.x, tmpvar_22.y, tmpvar_22.z, 1.0 - _time);
|
||||||
|
|
||||||
|
float4 tmpvar_24 = tex2D (_tex1, tmpvar_18);
|
||||||
|
|
||||||
|
float4 tmpvar_25 = float4(tmpvar_24.x, tmpvar_24.y, tmpvar_24.z, 1.0 - tmpvar_23.w);
|
||||||
|
|
||||||
|
float3 tmpvar_26_xyz = (((tmpvar_23.xyz * tmpvar_23.w) + (tmpvar_25.xyz * tmpvar_25.w)) * tmpvar_21);
|
||||||
|
float tmpvar_26_w = (tmpvar_23.w + tmpvar_25.w);
|
||||||
|
float4 tmpvar_26 = float4(tmpvar_26_xyz.x, tmpvar_26_xyz.y, tmpvar_26_xyz.z, tmpvar_26_w);
|
||||||
|
|
||||||
|
return tmpvar_26;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Fallback "VertexLit"
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FallBack off
|
||||||
}
|
}
|
||||||
@ -1,111 +1,71 @@
|
|||||||
Shader "QO/Effect/Wave" {
|
Shader "QO/Effect/Wave"
|
||||||
Properties {
|
{
|
||||||
_tex0 ("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
Properties
|
||||||
_tex1 ("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
{
|
||||||
_power ("_power : Wave Power", Float) = 0
|
_tex0("_tex0 : Original Image (RGBA)", 2D) = "white" {}
|
||||||
_count ("_count : Go Return Count", Float) = 0
|
_tex1("_tex1 : Transform Image (RGBA)", 2D) = "white" {}
|
||||||
_time ("_time : Time Rate (0 to 1)", Range(0,1)) = 0
|
_power("_power : Wave Power", Float) = 0
|
||||||
}
|
_count("_count : Go Return Count", Float) = 0
|
||||||
SubShader {
|
_time("_time : Time Rate (0 to 1)", Range(0,1)) = 0
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
LOD 200
|
LOD 200
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
Tags { "QUEUE" = "Transparent" "RenderType" = "Transparent" }
|
||||||
Pass {
|
|
||||||
Tags { "QUEUE"="Transparent" "RenderType"="Transparent" }
|
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
Blend SrcAlpha OneMinusSrcAlpha
|
||||||
Program "vp" {
|
Lighting Off
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
ZTest Always ZWrite Off
|
||||||
|
Fog { Mode off }
|
||||||
|
|
||||||
#ifdef VERTEX
|
|
||||||
|
|
||||||
varying lowp vec2 xlv_TEXCOORD0;
|
CGPROGRAM
|
||||||
varying lowp vec4 xlv_COLOR0;
|
#pragma vertex vert_img
|
||||||
uniform highp mat4 glstate_matrix_mvp;
|
#pragma fragment frag
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
#pragma fragmentoption ARB_precision_hint_fastest
|
||||||
attribute vec4 _glesVertex;
|
#include "UnityCG.cginc"
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
lowp vec2 tmpvar_1;
|
|
||||||
highp vec2 tmpvar_2;
|
|
||||||
tmpvar_2 = _glesMultiTexCoord0.xy;
|
|
||||||
tmpvar_1 = tmpvar_2;
|
|
||||||
gl_Position = (glstate_matrix_mvp * _glesVertex);
|
|
||||||
xlv_COLOR0 = vec4(1.0, 1.0, 1.0, 1.0);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
uniform sampler2D _tex0;
|
||||||
|
uniform sampler2D _tex1;
|
||||||
|
uniform float _count;
|
||||||
|
uniform float _power;
|
||||||
|
uniform float _time;
|
||||||
|
|
||||||
#endif
|
fixed4 frag(v2f_img i) :COLOR
|
||||||
#ifdef FRAGMENT
|
{
|
||||||
|
float sin_omega_6 = sin((_time * 3.14159));
|
||||||
|
float theta_5 = (((sin_omega_6 * 3.14159) * (_count * 2.0)) * (0.5 - i.uv.y));
|
||||||
|
float tmpvar_9 = cos(theta_5);
|
||||||
|
float wave_4 = ((tmpvar_9 * sin_omega_6) * _power);
|
||||||
|
float tmpvar_11 = (i.uv.x + wave_4);
|
||||||
|
float2 tmpvar_12 = float2(tmpvar_11, i.uv.y);
|
||||||
|
float check1_3 = float((-0.01 >= tmpvar_11));
|
||||||
|
float check2_2 = float((-0.01 >= (1.0 - tmpvar_11)));
|
||||||
|
float tmpvar_15 = float((0.0 >= (check1_3 + check2_2)));
|
||||||
|
float4 tmpvar_16 = tex2D (_tex0, tmpvar_12);
|
||||||
|
|
||||||
varying lowp vec2 xlv_TEXCOORD0;
|
float4 tmpvar_17 = float4(tmpvar_16.x, tmpvar_16.y, tmpvar_16.z, (1.0 - _time));
|
||||||
uniform highp float _time;
|
|
||||||
uniform highp float _count;
|
|
||||||
uniform highp float _power;
|
|
||||||
uniform sampler2D _tex1;
|
|
||||||
uniform sampler2D _tex0;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
mediump vec4 t0_1;
|
|
||||||
lowp float check2_2;
|
|
||||||
lowp float check1_3;
|
|
||||||
mediump float wave_4;
|
|
||||||
mediump float theta_5;
|
|
||||||
mediump float sin_omega_6;
|
|
||||||
highp float tmpvar_7;
|
|
||||||
tmpvar_7 = sin((_time * 3.14159));
|
|
||||||
sin_omega_6 = tmpvar_7;
|
|
||||||
highp float tmpvar_8;
|
|
||||||
tmpvar_8 = (((sin_omega_6 * 3.14159) * (_count * 2.0)) * (0.5 - xlv_TEXCOORD0.y));
|
|
||||||
theta_5 = tmpvar_8;
|
|
||||||
mediump float tmpvar_9;
|
|
||||||
tmpvar_9 = cos(theta_5);
|
|
||||||
highp float tmpvar_10;
|
|
||||||
tmpvar_10 = ((tmpvar_9 * sin_omega_6) * _power);
|
|
||||||
wave_4 = tmpvar_10;
|
|
||||||
mediump float tmpvar_11;
|
|
||||||
tmpvar_11 = (xlv_TEXCOORD0.x + wave_4);
|
|
||||||
mediump vec2 tmpvar_12;
|
|
||||||
tmpvar_12.x = tmpvar_11;
|
|
||||||
tmpvar_12.y = xlv_TEXCOORD0.y;
|
|
||||||
mediump float tmpvar_13;
|
|
||||||
tmpvar_13 = float((-0.01 >= tmpvar_11));
|
|
||||||
check1_3 = tmpvar_13;
|
|
||||||
mediump float tmpvar_14;
|
|
||||||
tmpvar_14 = float((-0.01 >= (1.0 - tmpvar_11)));
|
|
||||||
check2_2 = tmpvar_14;
|
|
||||||
lowp float tmpvar_15;
|
|
||||||
tmpvar_15 = float((0.0 >= (check1_3 + check2_2)));
|
|
||||||
lowp vec4 tmpvar_16;
|
|
||||||
tmpvar_16 = texture2D (_tex0, tmpvar_12);
|
|
||||||
highp vec4 tmpvar_17;
|
|
||||||
tmpvar_17.xyz = tmpvar_16.xyz;
|
|
||||||
tmpvar_17.w = (1.0 - _time);
|
|
||||||
t0_1 = tmpvar_17;
|
|
||||||
lowp vec4 tmpvar_18;
|
|
||||||
tmpvar_18 = texture2D (_tex1, tmpvar_12);
|
|
||||||
mediump vec4 tmpvar_19;
|
|
||||||
tmpvar_19.xyz = tmpvar_18.xyz;
|
|
||||||
tmpvar_19.w = (1.0 - t0_1.w);
|
|
||||||
mediump vec4 tmpvar_20;
|
|
||||||
tmpvar_20.xyz = (((t0_1.xyz * t0_1.w) + (tmpvar_19.xyz * tmpvar_19.w)) * tmpvar_15);
|
|
||||||
tmpvar_20.w = (t0_1.w + tmpvar_19.w);
|
|
||||||
gl_FragData[0] = tmpvar_20;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
float4 t0_1 = tmpvar_17;
|
||||||
|
float4 tmpvar_18 = tex2D (_tex1, tmpvar_12);
|
||||||
|
|
||||||
|
float4 tmpvar_19 = float4(tmpvar_18.x, tmpvar_18.y, tmpvar_18.z, (1.0 - t0_1.w));
|
||||||
|
|
||||||
#endif"
|
float3 tmpvar_20_xyz = (((t0_1.xyz * t0_1.w) + (tmpvar_19.xyz * tmpvar_19.w)) * tmpvar_15);
|
||||||
}
|
float tmpvar_20_w = (t0_1.w + tmpvar_19.w);
|
||||||
}
|
float4 tmpvar_20 = float4(tmpvar_20_xyz.x, tmpvar_20_xyz.y, tmpvar_20_xyz.z, tmpvar_20_w);
|
||||||
Program "fp" {
|
|
||||||
SubProgram "gles " {
|
return tmpvar_20;
|
||||||
"!!GLES"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Fallback "VertexLit"
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FallBack off
|
||||||
}
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
fixed4 SampleYCbCr ( half2 Yuv, half2 CbCruv)
|
||||||
|
{
|
||||||
|
#ifdef UNITY_COMPILER_CG
|
||||||
|
fixed4 YCrCb = fixed4(tex2D (_YTex, Yuv).a + 0.001, tex2D (_CrTex, CbCruv).a + 0.001, tex2D (_CbTex, CbCruv).a + 0.001, 1.0);
|
||||||
|
#else
|
||||||
|
fixed4 YCrCb = fixed4(tex2D (_YTex, Yuv).a, tex2D (_CrTex, CbCruv).a, tex2D (_CbTex, CbCruv).a, 1.0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return YCrCb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
half4 YCbCrToRGB( half4 YCbCr )
|
||||||
|
{
|
||||||
|
//Spent ages on these
|
||||||
|
//www.theora.org/doc/Theora.pdf
|
||||||
|
//R = ((Y - (16.0/255.0)) * (255.0/219.0)) + (2*(1 - 0.299)*((Cr - (128.0/255.0)) * (255.0/244.0)))
|
||||||
|
//G = ((Y - (16.0/255.0)) * (255.0/219.0)) - (2 * (((1 - 0.114)*0.114)/(1 - 0.114 - 0.299)) * ((Cb - (128.0/255.0)) * (255.0/244.0))) - (2 * (((1 - 0.299)*0.299)/(1 - 0.114 - 0.299)) * ((Cr - (128.0/255.0)) * (255.0/244.0)))
|
||||||
|
//B = ((Y - (16.0/255.0)) * (255.0/219.0)) + (2*(1 - 0.114)*((Cb - (128.0/255.0)) * (255.0/244.0)))
|
||||||
|
|
||||||
|
//half4 YCbCr2R = half4(1.16438, 1.4652, 0, -0.808535);
|
||||||
|
//half4 YCbCr2G = half4(1.16438, -0.714136, -0.359651, 0.46594);
|
||||||
|
//half4 YCbCr2B = half4(1.16438, 0,1.85189, -1.00263);
|
||||||
|
|
||||||
|
//However the original ones are more accurate with a colour bar test video
|
||||||
|
half4 YCbCr2R = half4(1.1643828125, 1.59602734375, 0, -.87078515625);
|
||||||
|
half4 YCbCr2G = half4(1.1643828125, -.81296875, -.39176171875, .52959375);
|
||||||
|
half4 YCbCr2B = half4(1.1643828125, 0, 2.017234375, -1.081390625);
|
||||||
|
|
||||||
|
half4 rgbVec;
|
||||||
|
|
||||||
|
rgbVec.x = dot(YCbCr2R, YCbCr);
|
||||||
|
rgbVec.y = dot(YCbCr2G, YCbCr);
|
||||||
|
rgbVec.z = dot(YCbCr2B, YCbCr);
|
||||||
|
rgbVec.w = 1.0f;
|
||||||
|
|
||||||
|
return rgbVec;
|
||||||
|
}
|
||||||
@ -1,73 +0,0 @@
|
|||||||
Shader "Color Space/YCrCbtoRGB Add" {
|
|
||||||
Properties {
|
|
||||||
_YTex ("Y (RGB)", 2D) = "white" {}
|
|
||||||
_CbTex ("Cb (RGB)", 2D) = "white" {}
|
|
||||||
_CrTex ("Cr (RGB)", 2D) = "white" {}
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
Tags { "QUEUE"="Overlay" "RenderType"="Opaque" }
|
|
||||||
Pass {
|
|
||||||
Tags { "QUEUE"="Overlay" "RenderType"="Opaque" }
|
|
||||||
Fog {
|
|
||||||
Color (0,0,0,0)
|
|
||||||
}
|
|
||||||
Blend One One
|
|
||||||
ColorMask RGB
|
|
||||||
Program "vp" {
|
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERTEX
|
|
||||||
|
|
||||||
varying highp vec2 xlv_TEXCOORD0;
|
|
||||||
uniform highp vec4 _YTex_ST;
|
|
||||||
uniform highp mat4 glstate_matrix_mvp;
|
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
|
||||||
attribute vec4 _glesVertex;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
gl_Position = (glstate_matrix_mvp * _glesVertex);
|
|
||||||
xlv_TEXCOORD0 = ((_glesMultiTexCoord0.xy * _YTex_ST.xy) + _YTex_ST.zw);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#ifdef FRAGMENT
|
|
||||||
|
|
||||||
varying highp vec2 xlv_TEXCOORD0;
|
|
||||||
uniform sampler2D _CrTex;
|
|
||||||
uniform sampler2D _CbTex;
|
|
||||||
uniform sampler2D _YTex;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
mediump vec4 rgbVec_1;
|
|
||||||
mediump vec4 yuvVec_2;
|
|
||||||
lowp vec4 tmpvar_3;
|
|
||||||
tmpvar_3.w = 1.0;
|
|
||||||
tmpvar_3.x = texture2D (_YTex, xlv_TEXCOORD0).x;
|
|
||||||
tmpvar_3.y = texture2D (_CbTex, xlv_TEXCOORD0).y;
|
|
||||||
tmpvar_3.z = texture2D (_CrTex, xlv_TEXCOORD0).z;
|
|
||||||
yuvVec_2 = tmpvar_3;
|
|
||||||
rgbVec_1.x = dot (vec4(1.16438, 0.0, 1.59603, -0.870785), yuvVec_2);
|
|
||||||
rgbVec_1.y = dot (vec4(1.16438, -0.391762, -0.812969, 0.529594), yuvVec_2);
|
|
||||||
rgbVec_1.z = dot (vec4(1.16438, 2.01723, 0.0, -1.08139), yuvVec_2);
|
|
||||||
rgbVec_1.w = 0.3;
|
|
||||||
gl_FragData[0] = rgbVec_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Program "fp" {
|
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Fallback "VertexLit"
|
|
||||||
}
|
|
||||||
@ -1,81 +1,59 @@
|
|||||||
Shader "Color Space/YCrCbtoRGB" {
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||||
Properties {
|
|
||||||
_YTex ("Y (RGB)", 2D) = "white" {}
|
Shader "Color Space/YCbCrtoRGB"
|
||||||
_CrTex ("Cr (RGB)", 2D) = "white" {}
|
{
|
||||||
_CbTex ("Cb (RGB)", 2D) = "white" {}
|
Properties
|
||||||
}
|
{
|
||||||
SubShader {
|
_YTex ("Y (RGB)", 2D) = "black" {}
|
||||||
Tags { "RenderType"="Opaque" }
|
_CrTex ("Cr (RGB)", 2D) = "gray" {}
|
||||||
Pass {
|
_CbTex ("Cb (RGB)", 2D) = "gray" {}
|
||||||
Tags { "RenderType"="Opaque" }
|
|
||||||
Fog {
|
|
||||||
Color (0,0,0,0)
|
|
||||||
}
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="Opaque" }
|
||||||
|
Pass
|
||||||
|
{
|
||||||
ColorMask RGB
|
ColorMask RGB
|
||||||
Program "vp" {
|
Lighting Off Fog { Color (0,0,0,0) }
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
#define SHADER_API_GLES 1
|
|
||||||
#define tex2D texture2D
|
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
#ifdef VERTEX
|
#include "UnityCG.cginc"
|
||||||
#define gl_ModelViewProjectionMatrix glstate_matrix_mvp
|
|
||||||
uniform mat4 glstate_matrix_mvp;
|
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
sampler2D _YTex;
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
sampler2D _CbTex;
|
||||||
|
sampler2D _CrTex;
|
||||||
|
|
||||||
uniform highp vec4 _YTex_ST;
|
#include "YCbCrtoRGB.cginc"
|
||||||
uniform highp vec4 _CbTex_ST;
|
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
struct v2f
|
||||||
attribute vec4 _glesVertex;
|
|
||||||
void main ()
|
|
||||||
{
|
{
|
||||||
mediump vec2 tmpvar_1;
|
float4 pos : SV_POSITION;
|
||||||
mediump vec2 tmpvar_2;
|
half2 uvY : TEXCOORD0;
|
||||||
highp vec2 tmpvar_3;
|
half2 uvCbCr : TEXCOORD1;
|
||||||
tmpvar_3 = ((_glesMultiTexCoord0.xy * _YTex_ST.xy) + _YTex_ST.zw);
|
};
|
||||||
tmpvar_1 = tmpvar_3;
|
|
||||||
highp vec2 tmpvar_4;
|
|
||||||
tmpvar_4 = ((_glesMultiTexCoord0.xy * _CbTex_ST.xy) + _CbTex_ST.zw);
|
|
||||||
tmpvar_2 = tmpvar_4;
|
|
||||||
gl_Position = (gl_ModelViewProjectionMatrix * _glesVertex);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
xlv_TEXCOORD1 = tmpvar_2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
float4 _YTex_ST;
|
||||||
#ifdef FRAGMENT
|
float4 _CbTex_ST;
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
v2f vert (appdata_base v)
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
|
||||||
uniform sampler2D _YTex;
|
|
||||||
uniform sampler2D _CrTex;
|
|
||||||
uniform sampler2D _CbTex;
|
|
||||||
void main ()
|
|
||||||
{
|
{
|
||||||
lowp vec4 rgbVec;
|
v2f o;
|
||||||
lowp vec4 tmpvar_1;
|
o.pos = UnityObjectToClipPos (v.vertex);
|
||||||
tmpvar_1.w = 1.0;
|
o.uvY = TRANSFORM_TEX (v.texcoord, _YTex);
|
||||||
tmpvar_1.x = texture2D (_YTex, xlv_TEXCOORD0).x;
|
o.uvCbCr = TRANSFORM_TEX (v.texcoord, _CbTex);
|
||||||
tmpvar_1.y = texture2D (_CrTex, xlv_TEXCOORD1).y;
|
return o;
|
||||||
tmpvar_1.z = texture2D (_CbTex, xlv_TEXCOORD1).z;
|
|
||||||
rgbVec.x = dot (vec4(1.16438, 0.0, 1.59603, -0.870785), tmpvar_1);
|
|
||||||
rgbVec.y = dot (vec4(1.16438, -0.391762, -0.812969, 0.529594), tmpvar_1);
|
|
||||||
rgbVec.z = dot (vec4(1.16438, 2.01723, 0.0, -1.08139), tmpvar_1);
|
|
||||||
rgbVec.w = 1.0;
|
|
||||||
gl_FragData[0] = rgbVec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif"
|
fixed4 frag (v2f i) : COLOR
|
||||||
}
|
{
|
||||||
}
|
return YCbCrToRGB(SampleYCbCr( i.uvY, i.uvCbCr));
|
||||||
Program "fp" {
|
}
|
||||||
SubProgram "gles " {
|
ENDCG
|
||||||
"!!GLES"
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -1,90 +1,92 @@
|
|||||||
Shader "Color Space/YCrCbtoRGB Chroma Key" {
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||||
Properties {
|
|
||||||
_YTex ("Y (RGB)", 2D) = "white" {}
|
Shader "Color Space/YCbCrtoRGB Chroma Key"
|
||||||
_CrTex ("Cr (RGB)", 2D) = "white" {}
|
{
|
||||||
_CbTex ("Cb (RGB)", 2D) = "white" {}
|
Properties
|
||||||
_KeyYCrCb ("Key Color YCrCb", Vector) = (0,0,0,-0.6)
|
{
|
||||||
_KeyScale ("Comparison Scale", Vector) = (0.2,1,1,4.5)
|
_YTex ("Y (RGB)", 2D) = "black" {}
|
||||||
}
|
_CrTex ("Cr (RGB)", 2D) = "gray" {}
|
||||||
SubShader {
|
_CbTex ("Cb (RGB)", 2D) = "gray" {}
|
||||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="True" "RenderType"="Transparent" }
|
|
||||||
Pass {
|
[YCbCr] _KeyYCbCr ("Chroma Key Color", Vector) = (0,0,0,-0.6)
|
||||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="True" "RenderType"="Transparent" }
|
[YCbCrPriority] _YCbCRDeltaScale ("YCbCr priority", Vector) = (0.1,1,1) //Different CbCr means a more different color than a different Y
|
||||||
ZWrite Off
|
_LowThreshold ("Low threashold", Range(0.0, 1.0)) = 0.2
|
||||||
Fog {
|
_HighThreshold ("High threashold", Range(0.0, 1.0)) = 0.25
|
||||||
Color (0,0,0,0)
|
|
||||||
}
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Lighting Off Fog { Color (0,0,0,0) }
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
Blend SrcAlpha OneMinusSrcAlpha
|
||||||
Program "vp" {
|
ZWrite Off
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES
|
|
||||||
#define SHADER_API_GLES 1
|
|
||||||
#define tex2D texture2D
|
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
#ifdef VERTEX
|
#include "UnityCG.cginc"
|
||||||
#define gl_ModelViewProjectionMatrix glstate_matrix_mvp
|
|
||||||
uniform mat4 glstate_matrix_mvp;
|
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
sampler2D _YTex;
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
sampler2D _CbTex;
|
||||||
|
sampler2D _CrTex;
|
||||||
|
|
||||||
uniform highp vec4 _YTex_ST;
|
#include "YCbCrtoRGB.cginc"
|
||||||
uniform highp vec4 _CbTex_ST;
|
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
|
||||||
attribute vec4 _glesVertex;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
mediump vec2 tmpvar_1;
|
|
||||||
mediump vec2 tmpvar_2;
|
|
||||||
highp vec2 tmpvar_3;
|
|
||||||
tmpvar_3 = ((_glesMultiTexCoord0.xy * _YTex_ST.xy) + _YTex_ST.zw);
|
|
||||||
tmpvar_1 = tmpvar_3;
|
|
||||||
highp vec2 tmpvar_4;
|
|
||||||
tmpvar_4 = ((_glesMultiTexCoord0.xy * _CbTex_ST.xy) + _CbTex_ST.zw);
|
|
||||||
tmpvar_2 = tmpvar_4;
|
|
||||||
gl_Position = (gl_ModelViewProjectionMatrix * _glesVertex);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
xlv_TEXCOORD1 = tmpvar_2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
half3 _KeyYCbCr;
|
||||||
|
half4 _YCbCRDeltaScale;
|
||||||
|
half _LowThreshold;
|
||||||
|
half _HighThreshold;
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float4 pos : SV_POSITION;
|
||||||
|
half2 uvY : TEXCOORD0;
|
||||||
|
half4 uvCbCr : TEXCOORD1; // u,v,offset,normalise
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
float4 _YTex_ST;
|
||||||
#ifdef FRAGMENT
|
float4 _CbTex_ST;
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
v2f vert (appdata_base v)
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
|
||||||
uniform sampler2D _YTex;
|
|
||||||
uniform mediump vec4 _KeyYCrCb;
|
|
||||||
uniform mediump vec4 _KeyScale;
|
|
||||||
uniform sampler2D _CrTex;
|
|
||||||
uniform sampler2D _CbTex;
|
|
||||||
void main ()
|
|
||||||
{
|
{
|
||||||
lowp vec4 rgbVec;
|
v2f o;
|
||||||
lowp vec4 tmpvar_1;
|
o.pos = UnityObjectToClipPos (v.vertex);
|
||||||
tmpvar_1.w = 1.0;
|
o.uvY = TRANSFORM_TEX (v.texcoord, _YTex);
|
||||||
tmpvar_1.x = texture2D (_YTex, xlv_TEXCOORD0).x;
|
o.uvCbCr.xy = TRANSFORM_TEX (v.texcoord, _CbTex);
|
||||||
tmpvar_1.y = texture2D (_CrTex, xlv_TEXCOORD1).y;
|
|
||||||
tmpvar_1.z = texture2D (_CbTex, xlv_TEXCOORD1).z;
|
//Work out the threasholds in the vertex shader
|
||||||
rgbVec.x = dot (vec4(1.16438, 0.0, 1.59603, -0.870785), tmpvar_1);
|
//float scaleLength = length(_YCbCRDeltaScale);
|
||||||
rgbVec.y = dot (vec4(1.16438, -0.391762, -0.812969, 0.529594), tmpvar_1);
|
float scaleLength = _YCbCRDeltaScale.w;
|
||||||
rgbVec.z = dot (vec4(1.16438, 2.01723, 0.0, -1.08139), tmpvar_1);
|
|
||||||
mediump float tmpvar_2;
|
float bottom = _LowThreshold * scaleLength;
|
||||||
tmpvar_2 = ((length (((tmpvar_1.xyz - _KeyYCrCb.xyz) * _KeyScale.xyz)) + _KeyYCrCb.w) * _KeyScale.w);
|
float top = _HighThreshold * scaleLength;
|
||||||
rgbVec.w = tmpvar_2;
|
|
||||||
gl_FragData[0] = rgbVec;
|
float range = top - bottom;
|
||||||
|
float offset = -bottom;
|
||||||
|
|
||||||
|
float normalise = 1.0/range;
|
||||||
|
|
||||||
|
o.uvCbCr.z = offset;
|
||||||
|
o.uvCbCr.w = normalise;
|
||||||
|
|
||||||
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif"
|
fixed4 frag (v2f i) : COLOR
|
||||||
}
|
{
|
||||||
}
|
fixed4 YCbCr = SampleYCbCr( i.uvY, i.uvCbCr);
|
||||||
Program "fp" {
|
fixed4 rgbVec = YCbCrToRGB(YCbCr);
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES"
|
half3 deltaVec = (YCbCr.xyz - _KeyYCbCr.xyz) * _YCbCRDeltaScale.xyz;
|
||||||
}
|
|
||||||
}
|
rgbVec.w = (length(deltaVec) + i.uvCbCr.z)* i.uvCbCr.w;
|
||||||
|
|
||||||
|
return rgbVec;
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -1,100 +1,79 @@
|
|||||||
Shader "Color Space/YCrCbtoRGB Split Alpha" {
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||||
Properties {
|
|
||||||
_YTex ("Y (RGB)", 2D) = "white" {}
|
Shader "Color Space/YCrCbtoRGB Split Alpha"
|
||||||
_CrTex ("Cr (RGB)", 2D) = "white" {}
|
{
|
||||||
_CbTex ("Cb (RGB)", 2D) = "white" {}
|
Properties
|
||||||
}
|
{
|
||||||
SubShader {
|
_YTex ("Y (RGB)", 2D) = "black" {}
|
||||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="True" "RenderType"="Transparent" }
|
_CrTex ("Cr (RGB)", 2D) = "gray" {}
|
||||||
Pass {
|
_CbTex ("Cb (RGB)", 2D) = "gray" {}
|
||||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="True" "RenderType"="Transparent" }
|
|
||||||
ZWrite Off
|
[KeywordEnum(Vertical, Horizontal)] Mode ("Alpha Mode", Float) = 0
|
||||||
Fog {
|
|
||||||
Color (0,0,0,0)
|
|
||||||
}
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||||
|
Pass
|
||||||
|
{
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
Blend SrcAlpha OneMinusSrcAlpha
|
||||||
ColorMask RGB
|
ColorMask RGB
|
||||||
Program "vp" {
|
Lighting Off Fog { Color (0,0,0,0) }
|
||||||
SubProgram "gles " {
|
ZWrite Off
|
||||||
"!!GLES
|
|
||||||
#define SHADER_API_GLES 1
|
|
||||||
#define tex2D texture2D
|
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
#pragma multi_compile MODE_VERTICAL MODE_HORIZONTAL
|
||||||
|
|
||||||
#ifdef VERTEX
|
#include "UnityCG.cginc"
|
||||||
#define gl_ModelViewProjectionMatrix glstate_matrix_mvp
|
|
||||||
uniform mat4 glstate_matrix_mvp;
|
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD2;
|
sampler2D _YTex;
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
sampler2D _CbTex;
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
sampler2D _CrTex;
|
||||||
|
|
||||||
uniform highp vec4 _YTex_ST;
|
#include "YCbCrtoRGB.cginc"
|
||||||
uniform highp vec4 _CbTex_ST;
|
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
struct v2f
|
||||||
attribute vec4 _glesVertex;
|
|
||||||
void main ()
|
|
||||||
{
|
{
|
||||||
highp vec4 texcoordTop;
|
float4 pos : SV_POSITION;
|
||||||
highp vec4 texcoordBottom;
|
half2 uvY : TEXCOORD0;
|
||||||
mediump vec2 tmpvar_1;
|
half2 uvAlpha : TEXCOORD1;
|
||||||
mediump vec2 tmpvar_2;
|
half2 uvCbCr : TEXCOORD2;
|
||||||
mediump vec2 tmpvar_3;
|
};
|
||||||
texcoordBottom = _glesMultiTexCoord0;
|
|
||||||
texcoordBottom.y = (_glesMultiTexCoord0.y / 2.0);
|
|
||||||
texcoordTop = _glesMultiTexCoord0;
|
|
||||||
texcoordTop.y = (texcoordBottom.y + 0.5);
|
|
||||||
highp vec2 tmpvar_4;
|
|
||||||
tmpvar_4 = ((texcoordTop.xy * _YTex_ST.xy) + _YTex_ST.zw);
|
|
||||||
tmpvar_1 = tmpvar_4;
|
|
||||||
highp vec2 tmpvar_5;
|
|
||||||
tmpvar_5 = ((texcoordBottom.xy * _YTex_ST.xy) + _YTex_ST.zw);
|
|
||||||
tmpvar_2 = tmpvar_5;
|
|
||||||
highp vec2 tmpvar_6;
|
|
||||||
tmpvar_6 = ((texcoordTop.xy * _CbTex_ST.xy) + _CbTex_ST.zw);
|
|
||||||
tmpvar_3 = tmpvar_6;
|
|
||||||
gl_Position = (gl_ModelViewProjectionMatrix * _glesVertex);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
xlv_TEXCOORD1 = tmpvar_2;
|
|
||||||
xlv_TEXCOORD2 = tmpvar_3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
float4 _YTex_ST;
|
||||||
|
float4 _CbTex_ST;
|
||||||
|
|
||||||
|
v2f vert (appdata_base v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
o.pos = UnityObjectToClipPos (v.vertex);
|
||||||
|
|
||||||
#endif
|
float4 texcoordBottom = v.texcoord;
|
||||||
#ifdef FRAGMENT
|
float4 texcoordTop = v.texcoord;
|
||||||
|
#if MODE_VERTICAL
|
||||||
|
texcoordBottom.y = ( v.texcoord.y / 2.0f );
|
||||||
|
texcoordTop.y = texcoordBottom.y + 0.5f;
|
||||||
|
#else
|
||||||
|
texcoordBottom.x = ( v.texcoord.x / 2.0f );
|
||||||
|
texcoordTop.x = texcoordBottom.x + 0.5f;
|
||||||
|
#endif
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD2;
|
o.uvY = TRANSFORM_TEX (texcoordTop, _YTex);
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
o.uvAlpha = TRANSFORM_TEX (texcoordBottom, _YTex);
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
o.uvCbCr = TRANSFORM_TEX (texcoordTop, _CbTex);
|
||||||
uniform sampler2D _YTex;
|
return o;
|
||||||
uniform sampler2D _CrTex;
|
|
||||||
uniform sampler2D _CbTex;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
lowp vec4 rgbVec;
|
|
||||||
lowp vec4 tmpvar_1;
|
|
||||||
tmpvar_1.w = 1.0;
|
|
||||||
tmpvar_1.x = texture2D (_YTex, xlv_TEXCOORD0).x;
|
|
||||||
tmpvar_1.y = texture2D (_CrTex, xlv_TEXCOORD2).y;
|
|
||||||
tmpvar_1.z = texture2D (_CbTex, xlv_TEXCOORD2).z;
|
|
||||||
rgbVec.x = dot (vec4(1.16438, 0.0, 1.59603, -0.870785), tmpvar_1);
|
|
||||||
rgbVec.y = dot (vec4(1.16438, -0.391762, -0.812969, 0.529594), tmpvar_1);
|
|
||||||
rgbVec.z = dot (vec4(1.16438, 2.01723, 0.0, -1.08139), tmpvar_1);
|
|
||||||
rgbVec.w = ((texture2D (_YTex, xlv_TEXCOORD1).y - 0.0627451) * 1.16438);
|
|
||||||
gl_FragData[0] = rgbVec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : COLOR
|
||||||
|
{
|
||||||
|
fixed4 rgbVec = YCbCrToRGB(SampleYCbCr( i.uvY, i.uvCbCr));
|
||||||
|
|
||||||
|
rgbVec.w = ((tex2D(_YTex, i.uvAlpha).a - (16.0/255.0)) * (255.0/219.0));
|
||||||
|
|
||||||
#endif"
|
return rgbVec;
|
||||||
}
|
}
|
||||||
}
|
ENDCG
|
||||||
Program "fp" {
|
}
|
||||||
SubProgram "gles " {
|
|
||||||
"!!GLES"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,90 +1,63 @@
|
|||||||
Shader "Color Space/YCrCbtoRGB Trans" {
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||||
Properties {
|
|
||||||
_YTex ("Y (RGB)", 2D) = "white" {}
|
Shader "Color Space/YCbCrtoRGB Trans"
|
||||||
_CrTex ("Cr (RGB)", 2D) = "white" {}
|
{
|
||||||
_CbTex ("Cb (RGB)", 2D) = "white" {}
|
Properties
|
||||||
_TintColor ("Color", Color) = (1,1,1,1)
|
{
|
||||||
}
|
_YTex ("Y (RGB)", 2D) = "black" {}
|
||||||
SubShader {
|
_CrTex ("Cr (RGB)", 2D) = "gray" {}
|
||||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="True" "RenderType"="Transparent" }
|
_CbTex ("Cb (RGB)", 2D) = "gray" {}
|
||||||
Pass {
|
_TintColor ("Color", COLOR) = (1,1,1,1)
|
||||||
Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="True" "RenderType"="Transparent" }
|
|
||||||
ZWrite Off
|
|
||||||
Fog {
|
|
||||||
Color (0,0,0,0)
|
|
||||||
}
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||||
|
Pass
|
||||||
|
{
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
Blend SrcAlpha OneMinusSrcAlpha
|
||||||
ColorMask RGB
|
ColorMask RGB
|
||||||
Program "vp" {
|
Lighting Off Fog { Color (0,0,0,0) }
|
||||||
SubProgram "gles " {
|
ZWrite Off
|
||||||
"!!GLES
|
|
||||||
#define SHADER_API_GLES 1
|
|
||||||
#define tex2D texture2D
|
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
#ifdef VERTEX
|
#include "UnityCG.cginc"
|
||||||
#define gl_ModelViewProjectionMatrix glstate_matrix_mvp
|
|
||||||
uniform mat4 glstate_matrix_mvp;
|
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
sampler2D _YTex;
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
sampler2D _CbTex;
|
||||||
|
sampler2D _CrTex;
|
||||||
|
|
||||||
uniform highp vec4 _YTex_ST;
|
#include "YCbCrtoRGB.cginc"
|
||||||
uniform highp vec4 _CbTex_ST;
|
|
||||||
attribute vec4 _glesMultiTexCoord0;
|
|
||||||
attribute vec4 _glesVertex;
|
|
||||||
void main ()
|
|
||||||
{
|
|
||||||
mediump vec2 tmpvar_1;
|
|
||||||
mediump vec2 tmpvar_2;
|
|
||||||
highp vec2 tmpvar_3;
|
|
||||||
tmpvar_3 = ((_glesMultiTexCoord0.xy * _YTex_ST.xy) + _YTex_ST.zw);
|
|
||||||
tmpvar_1 = tmpvar_3;
|
|
||||||
highp vec2 tmpvar_4;
|
|
||||||
tmpvar_4 = ((_glesMultiTexCoord0.xy * _CbTex_ST.xy) + _CbTex_ST.zw);
|
|
||||||
tmpvar_2 = tmpvar_4;
|
|
||||||
gl_Position = (gl_ModelViewProjectionMatrix * _glesVertex);
|
|
||||||
xlv_TEXCOORD0 = tmpvar_1;
|
|
||||||
xlv_TEXCOORD1 = tmpvar_2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fixed4 _TintColor;
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float4 pos : SV_POSITION;
|
||||||
|
half2 uvY : TEXCOORD0;
|
||||||
|
half2 uvCbCr : TEXCOORD1;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
float4 _YTex_ST;
|
||||||
#ifdef FRAGMENT
|
float4 _CbTex_ST;
|
||||||
|
|
||||||
varying mediump vec2 xlv_TEXCOORD1;
|
v2f vert (appdata_base v)
|
||||||
varying mediump vec2 xlv_TEXCOORD0;
|
|
||||||
uniform sampler2D _YTex;
|
|
||||||
uniform lowp vec4 _TintColor;
|
|
||||||
uniform sampler2D _CrTex;
|
|
||||||
uniform sampler2D _CbTex;
|
|
||||||
void main ()
|
|
||||||
{
|
{
|
||||||
lowp vec4 rgbVec;
|
v2f o;
|
||||||
lowp vec4 tmpvar_1;
|
o.pos = UnityObjectToClipPos (v.vertex);
|
||||||
tmpvar_1.w = 1.0;
|
o.uvY = TRANSFORM_TEX (v.texcoord, _YTex);
|
||||||
tmpvar_1.x = texture2D (_YTex, xlv_TEXCOORD0).x;
|
o.uvCbCr = TRANSFORM_TEX (v.texcoord, _CbTex);
|
||||||
tmpvar_1.y = texture2D (_CrTex, xlv_TEXCOORD1).y;
|
return o;
|
||||||
tmpvar_1.z = texture2D (_CbTex, xlv_TEXCOORD1).z;
|
|
||||||
rgbVec.x = dot (vec4(1.16438, 0.0, 1.59603, -0.870785), tmpvar_1);
|
|
||||||
rgbVec.y = dot (vec4(1.16438, -0.391762, -0.812969, 0.529594), tmpvar_1);
|
|
||||||
rgbVec.z = dot (vec4(1.16438, 2.01723, 0.0, -1.08139), tmpvar_1);
|
|
||||||
rgbVec.w = 1.0;
|
|
||||||
lowp vec4 tmpvar_2;
|
|
||||||
tmpvar_2 = (rgbVec * _TintColor);
|
|
||||||
rgbVec = tmpvar_2;
|
|
||||||
gl_FragData[0] = tmpvar_2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif"
|
fixed4 frag (v2f i) : COLOR
|
||||||
}
|
{
|
||||||
}
|
return YCbCrToRGB(SampleYCbCr( i.uvY, i.uvCbCr))*_TintColor;
|
||||||
Program "fp" {
|
}
|
||||||
SubProgram "gles " {
|
ENDCG
|
||||||
"!!GLES"
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue