From 5aea37e8c8641dab72bd135d89ed12a8349ecc14 Mon Sep 17 00:00:00 2001 From: Takashi Sakai Date: Tue, 24 Apr 2018 03:01:07 +0900 Subject: [PATCH 1/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a34a463..43edef7 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ This will suppress extra draw calls and improve performance. ## Demo * ![demo](https://user-images.githubusercontent.com/12690315/39131616-dcf7ea60-474a-11e8-8e20-f9e5bd8b3f5c.gif) - * Only 1 draw call! + * Just 1 draw call! From 13c06b491154df68b96434f4ca521b3aebc2f42d Mon Sep 17 00:00:00 2001 From: Takashi Sakai Date: Tue, 24 Apr 2018 08:31:17 +0900 Subject: [PATCH 2/7] Update README.md --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 43edef7..2226f3c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ DissolveEffectForUGUI ### NOTE: This project *will* be merged to [UIEffect](https://github.com/mob-sakai/UIEffect). A dissolve effect for uGUI, without material instancing. -![image](https://user-images.githubusercontent.com/12690315/39131615-dccdc2bc-474a-11e8-84b2-0513b64168a7.png) + +![image](https://user-images.githubusercontent.com/12690315/39158165-6f8d68fc-4799-11e8-837f-4b74943d3f36.png) [![](https://img.shields.io/github/release/mob-sakai/DissolveEffectForUGUI.svg?label=latest%20version)](https://github.com/mob-sakai/DissolveEffectForUGUI/release) [![](https://img.shields.io/github/release-date/mob-sakai/DissolveEffectForUGUI.svg)](https://github.com/mob-sakai/DissolveEffectForUGUI/releases) @@ -22,13 +23,17 @@ A dissolve effect for uGUI, without material instancing.



## Description +![image](https://user-images.githubusercontent.com/12690315/39131615-dccdc2bc-474a-11e8-84b2-0513b64168a7.png) + DissolveEffectForUGUI applies _dissolve-effect_ to uGUI element (Image, RawImage, Text, etc...) **WITHOUT material instancing**. This will suppress extra draw calls and improve performance. -* Noise pattern image -* Edge width -* Outer/inner edge color -* Outer/inner edge softness +* Parameters + * Dissolve factor + * Noise pattern image (in material) + * Edge width (in material) + * Outer/inner edge color (in material) + * Outer/inner edge softness (in material) ![image](https://user-images.githubusercontent.com/12690315/39143377-b9e632c0-4768-11e8-9d26-717304df41fb.png) From eb31cc03c6a476206bdf459445f4944e01cbc881 Mon Sep 17 00:00:00 2001 From: Takashi Sakai Date: Tue, 24 Apr 2018 08:46:19 +0900 Subject: [PATCH 3/7] Changed: location -> dissolveFactor --- .../Demo/Dissolve.controller | 16 ++++++++-------- Assets/DissolveEffectForUGUI/UIDissolve.cs | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller b/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller index ee740f7..9b9fa6d 100644 --- a/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller +++ b/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller @@ -34,7 +34,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: A classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} @@ -56,7 +56,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: B classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} @@ -78,7 +78,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: C classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} @@ -100,7 +100,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: D classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} @@ -176,7 +176,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: A classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} @@ -198,7 +198,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: B classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} @@ -220,7 +220,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: C classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} @@ -242,7 +242,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - attribute: m_Location + attribute: m_DissolveFactor path: D classID: 114 script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3} diff --git a/Assets/DissolveEffectForUGUI/UIDissolve.cs b/Assets/DissolveEffectForUGUI/UIDissolve.cs index 2bc1199..ccbf884 100644 --- a/Assets/DissolveEffectForUGUI/UIDissolve.cs +++ b/Assets/DissolveEffectForUGUI/UIDissolve.cs @@ -30,7 +30,7 @@ public class UIDissolve : BaseMeshEffect //################################ // Serialize Members. //################################ - [SerializeField] [Range(0, 1)] float m_Location = 0; + [SerializeField] [Range(0, 1)] float m_DissolveFactor = 0; [SerializeField] Material m_EffectMaterial; @@ -45,7 +45,7 @@ public class UIDissolve : BaseMeshEffect /// /// Location for effect. /// - public float location { get { return m_Location; } set { m_Location = Mathf.Clamp(value, 0, 1); _SetDirty(); } } + public float dissolveFactor { get { return m_DissolveFactor; } set { m_DissolveFactor = Mathf.Clamp(value, 0, 1); _SetDirty(); } } /// /// Effect material. @@ -129,7 +129,7 @@ public override void ModifyMesh(VertexHelper vh) var x = Mathf.Clamp01 (vertex.position.x / rect.width + 0.5f); var y = Mathf.Clamp01 (vertex.position.y / rect.height + 0.5f); - vertex.uv1 = new Vector2 (_PackToFloat (x, y, location), 0); + vertex.uv1 = new Vector2 (_PackToFloat (x, y, dissolveFactor), 0); vh.SetUIVertex(vertex, i); } From 294260197ef6bd7f38c7db3c730e4e0c0b68f8ef Mon Sep 17 00:00:00 2001 From: Takashi Sakai Date: Tue, 24 Apr 2018 08:46:42 +0900 Subject: [PATCH 4/7] Feature: Skip process when dissolve factor equal 0 --- Assets/DissolveEffectForUGUI/UIDissolve.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assets/DissolveEffectForUGUI/UIDissolve.cs b/Assets/DissolveEffectForUGUI/UIDissolve.cs index ccbf884..4b85d94 100644 --- a/Assets/DissolveEffectForUGUI/UIDissolve.cs +++ b/Assets/DissolveEffectForUGUI/UIDissolve.cs @@ -114,8 +114,7 @@ public static Material GetMaterial(string shaderName) /// public override void ModifyMesh(VertexHelper vh) { - - if (!IsActive()) + if (!IsActive() || dissolveFactor <= 0) return; // rect. From efdab89b97a11c2c0a87427a7d5a4ed8acc746e8 Mon Sep 17 00:00:00 2001 From: Takashi Sakai Date: Tue, 24 Apr 2018 08:50:56 +0900 Subject: [PATCH 5/7] Feature: Skip process when dissolve factor equal 1 --- Assets/DissolveEffectForUGUI/UIDissolve.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/DissolveEffectForUGUI/UIDissolve.cs b/Assets/DissolveEffectForUGUI/UIDissolve.cs index 4b85d94..ef47a8b 100644 --- a/Assets/DissolveEffectForUGUI/UIDissolve.cs +++ b/Assets/DissolveEffectForUGUI/UIDissolve.cs @@ -117,6 +117,12 @@ public override void ModifyMesh(VertexHelper vh) if (!IsActive() || dissolveFactor <= 0) return; + // Skip process. + if (1 <= dissolveFactor) { + vh.Clear (); + return; + } + // rect. Rect rect = graphic.rectTransform.rect; From dc5f52b4fa780f997bf0d8924ef894981d51d403 Mon Sep 17 00:00:00 2001 From: Takashi Sakai Date: Tue, 24 Apr 2018 12:25:38 +0900 Subject: [PATCH 6/7] update release script --- release.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/release.sh b/release.sh index 99a1507..c72b21e 100755 --- a/release.sh +++ b/release.sh @@ -1,5 +1,8 @@ #!/bin/bash -e +# NOTE: Set an environment variable `CHANGELOG_GITHUB_TOKEN` by running the following command at the prompt, or by adding it to your shell profile (e.g., ~/.bash_profile or ~/.zshrc): +# export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»" + # Release the project with the following steps: # 1. Update the release version in package.json. # 2. Update "CHANGELOG.md" using "github_changelog_generator-1.15.0.pre.rc". @@ -7,17 +10,16 @@ # 4. Merge into master branch. # 5. Export unitypackage. # 6. Release using "gh-release-3.2.0". (Upload unitypackage) -UNITY_PATH=/Applications/Unity5.5.0p4/Unity5.5.0p4.app/Contents/MacOS/Unity -# input version +# input release version PACKAGE_NAME=`node -pe 'require("./package.json").name'` echo Github Release: $PACKAGE_NAME read -p "[? release version (for example: 1.0.0): " RELEASE_VERSION [ -z "$RELEASE_VERSION" ] && exit -# update version +# update version in package.json git checkout -B release develop sed -i -e "s/\"version\": \(.*\)/\"version\": \"${RELEASE_VERSION}\",/g" package.json @@ -36,6 +38,12 @@ read -p "[? continue? (y/N):" yn case "$yn" in [yY]*) ;; *) exit ;; esac +# export unitypackage +UNITY_EDITOR=`node -pe 'require("./package.json").unity'` +PACKAGE_SRC=`node -pe 'require("./package.json").src'` +"$UNITY_EDITOR" -quit -batchmode -projectPath "`pwd`" -exportpackage "$PACKAGE_SRC" "$PACKAGE_NAME.unitypackage" + + # commit files git add CHANGELOG.md -f git add package.json -f @@ -49,10 +57,8 @@ git branch -D release git push origin master -# export .unitypackage and release on Github -PACKAGE_SRC=`node -pe 'require("./package.json").src'` -$UNITY_PATH -quit -batchmode -projectPath "`pwd`" -exportpackage $PACKAGE_SRC $PACKAGE_NAME.unitypackage -gh-release --draft --assets $PACKAGE_NAME.unitypackage +# upload unitypackage and release on Github +gh-release --draft --assets "$PACKAGE_NAME.unitypackage" echo "\n\n$PACKAGE_NAME v$RELEASE_VERSION has been successfully released!\n" From 9a296e62f7232a5ec1af218776a9caa58d5bf60b Mon Sep 17 00:00:00 2001 From: Takashi Sakai Date: Tue, 24 Apr 2018 12:29:18 +0900 Subject: [PATCH 7/7] update change log --- CHANGELOG.md | 11 ++++++++++- package.json | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc75f1..e30ceda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Changelog -## [v0.2.0](https://github.com/mob-sakai/DissolveEffectForUGUI/tree/v0.2.0) (2018-04-24) +## [v0.3.0](https://github.com/mob-sakai/DissolveEffectForUGUI/tree/v0.3.0) (2018-04-24) + +[Full Changelog](https://github.com/mob-sakai/DissolveEffectForUGUI/compare/v0.2.0...v0.3.0) + +**Implemented enhancements:** + +- Feature: Skip process when dissolve factor equal 1 [\#5](https://github.com/mob-sakai/DissolveEffectForUGUI/issues/5) +- Feature: Skip process when dissolve factor equal 0 [\#4](https://github.com/mob-sakai/DissolveEffectForUGUI/issues/4) + +## [v0.2.0](https://github.com/mob-sakai/DissolveEffectForUGUI/tree/v0.2.0) (2018-04-23) [Full Changelog](https://github.com/mob-sakai/DissolveEffectForUGUI/compare/v0.1.0...v0.2.0) diff --git a/package.json b/package.json index b884c4f..adafef1 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "DissolveEffectForUGUI", - "version": "0.1.0", + "version": "0.3.0", "repository": { "type": "git", "url": "git+https://github.com/mob-sakai/DissolveEffectForUGUI.git" }, "src": "Assets/DissolveEffectForUGUI", + "unity": "/Applications/Unity5.5.0p4/Unity5.5.0p4.app/Contents/MacOS/Unity", "license": "MIT" }