diff --git a/Assets/ShinyEffectForUGUI/UI-Effect-Shiny.shader b/Assets/ShinyEffectForUGUI/UI-Effect-Shiny.shader
index 5bea61f..5c4ae92 100644
--- a/Assets/ShinyEffectForUGUI/UI-Effect-Shiny.shader
+++ b/Assets/ShinyEffectForUGUI/UI-Effect-Shiny.shader
@@ -72,9 +72,10 @@ Shader "UI/Hidden/UI-Effect-Shiny"
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
+ float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
- half4 effectFactor : TEXCOORD1;
+ half4 effectFactor : TEXCOORD2;
};
fixed4 _Color;
@@ -107,6 +108,8 @@ Shader "UI/Hidden/UI-Effect-Shiny"
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
+ OUT.worldPosition = IN.vertex;
+
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
@@ -122,6 +125,12 @@ Shader "UI/Hidden/UI-Effect-Shiny"
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
+ color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
+
+ #ifdef UNITY_UI_ALPHACLIP
+ clip (color.a - 0.001);
+ #endif
+
fixed lowLevel = IN.effectFactor.y - IN.effectFactor.z;
fixed highLevel = IN.effectFactor.y + IN.effectFactor.z;
fixed shinePower = smoothstep(IN.effectFactor.z, 0, abs(abs(clamp(IN.effectFactor.x, lowLevel, highLevel) - IN.effectFactor.y)));
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d68dc9..80627af 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## [v0.2.0](https://github.com/mob-sakai/ShinyEffectForUGUI/tree/v0.2.0) (2018-04-09)
+
+[Full Changelog](https://github.com/mob-sakai/ShinyEffectForUGUI/compare/v0.1.0...v0.2.0)
+
+**Fixed bugs:**
+
+- Bug: Clipping is disabled. [\#5](https://github.com/mob-sakai/ShinyEffectForUGUI/issues/5)
+
## [v0.1.0](https://github.com/mob-sakai/ShinyEffectForUGUI/tree/v0.1.0) (2018-04-09)
[Full Changelog](https://github.com/mob-sakai/ShinyEffectForUGUI/compare/3aa9ebbad004f7a812c93133f90336b06ffd034f...v0.1.0)
diff --git a/README.md b/README.md
index 313b7dd..338d348 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
ShinyEffectForUGUI
===
-ShinyEffectForUGUI
+### NOTE: This project *will* be merged to [UIEffect](https://github.com/mob-sakai/UIEffect).
Shiny effect without Mask commponent.
Since useless draw calls are suppressed, performance is good!
-
+
[](https://github.com/mob-sakai/ShinyEffectForUGUI/release)
[](https://github.com/mob-sakai/ShinyEffectForUGUI/releases)
@@ -17,7 +17,7 @@ Since useless draw calls are suppressed, performance is good!
[](https://github.com/mob-sakai/ShinyEffectForUGUI/compare/master...develop)
-<< [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/ShinyEffectForUGUI/releases) | [Usage](#usage) | [Development Note](#development-note) | [Change log](https://github.com/mob-sakai/ShinyEffectForUGUI/blob/develop/CHANGELOG.md) >>
+<< [Description](#Description) | [Demo](#demo) | [Download](https://github.com/mob-sakai/ShinyEffectForUGUI/releases) | [Usage](#usage) | [Development Note](#development-note) | [Change log](https://github.com/mob-sakai/ShinyEffectForUGUI/blob/develop/CHANGELOG.md) >>
@@ -48,7 +48,7 @@ This will suppress extra draw calls and improve performance.
## Demo
-[WebGL Demo](https://)
+
diff --git a/package.json b/package.json
index a5bc45f..7dcf3f2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ShinyEffectForUGUI",
- "version": "0.1.0",
+ "version": "0.2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/mob-sakai/ShinyEffectForUGUI.git"