mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:42:37 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ef89675c6b | |||
| ee7c799ea6 | |||
| 0570c22385 | |||
| 7112636409 |
@@ -1,6 +1,3 @@
|
||||
user=mob-sakai
|
||||
project=UIEffect
|
||||
issues-wo-labels=false
|
||||
pr-wo-labels=false
|
||||
exclude_labels=duplicate,question,invalid,wontfix,Duplicate,Question,Invalid,Wontfix,Meta: Exclude From Changelog,unreleased
|
||||
unreleased=false
|
||||
exclude_labels=duplicate,question,invalid,wontfix,Duplicate,Question,Invalid,Wontfix,Meta: Exclude From Changelog
|
||||
@@ -37,9 +37,7 @@ Shader "UI/Hidden/UI-EffectCapture"
|
||||
fixed4 colorFactor : COLOR1;
|
||||
#endif
|
||||
|
||||
#if defined (UI_TONE) || defined (UI_BLUR)
|
||||
half4 effectFactor : TEXCOORD2;
|
||||
#endif
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
@@ -51,16 +49,9 @@ Shader "UI/Hidden/UI-EffectCapture"
|
||||
{
|
||||
v2f OUT;
|
||||
OUT.vertex = UnityObjectToClipPos(v.vertex);
|
||||
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
OUT.texcoord = half2(v.texcoord.x, 1 - v.texcoord.y);
|
||||
#else
|
||||
OUT.texcoord = v.texcoord;
|
||||
#endif
|
||||
|
||||
#if defined (UI_TONE) || defined (UI_BLUR)
|
||||
OUT.texcoord = v.texcoord;
|
||||
OUT.effectFactor = _EffectFactor;
|
||||
#endif
|
||||
|
||||
#if UI_TONE_HUE
|
||||
OUT.effectFactor.y = sin(OUT.effectFactor.x*3.14159265359*2);
|
||||
@@ -73,6 +64,10 @@ Shader "UI/Hidden/UI-EffectCapture"
|
||||
OUT.colorFactor = _ColorFactor;
|
||||
#endif
|
||||
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
OUT.texcoord.y = lerp(OUT.texcoord.y, 1 - OUT.texcoord.y, OUT.effectFactor.w);
|
||||
#endif
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,22 +142,6 @@ namespace Coffee.UIExtensions
|
||||
// When not displaying, clear vertex.
|
||||
if (texture == null || effectColor.a < 1 / 255f || canvasRenderer.GetAlpha() < 1 / 255f)
|
||||
vh.Clear();
|
||||
#if UNITY_STANDALONE_WIN
|
||||
else if(_capturedIterations % 2 == 0)
|
||||
{
|
||||
Debug.Log(iterations);
|
||||
base.OnPopulateMesh(vh);
|
||||
int count = vh.currentVertCount;
|
||||
UIVertex vt = UIVertex.simpleVert;
|
||||
Vector2 one = Vector2.one;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
vh.PopulateUIVertex(ref vt, i);
|
||||
vt.uv0 = new Vector2(vt.uv0.x, 1-vt.uv0.y);
|
||||
vh.SetUIVertex(vt, i);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else
|
||||
base.OnPopulateMesh(vh);
|
||||
}
|
||||
@@ -257,7 +241,7 @@ namespace Coffee.UIExtensions
|
||||
_buffer.Blit(BuiltinRenderTextureType.CurrentActive, s_CopyId);
|
||||
|
||||
// Set properties.
|
||||
_buffer.SetGlobalVector("_EffectFactor", new Vector4(toneLevel, 0, blur, 0));
|
||||
_buffer.SetGlobalVector("_EffectFactor", new Vector4(toneLevel, 0, blur, 1));
|
||||
_buffer.SetGlobalVector("_ColorFactor", new Vector4(effectColor.r, effectColor.g, effectColor.b, effectColor.a));
|
||||
|
||||
// Blit without effect.
|
||||
@@ -265,7 +249,6 @@ namespace Coffee.UIExtensions
|
||||
{
|
||||
_buffer.Blit(s_CopyId, rtId);
|
||||
_buffer.ReleaseTemporaryRT(s_CopyId);
|
||||
_capturedIterations = 1;
|
||||
}
|
||||
// Blit with effect.
|
||||
else
|
||||
@@ -278,6 +261,7 @@ namespace Coffee.UIExtensions
|
||||
// Iterate the operation.
|
||||
if(1 < m_Iterations)
|
||||
{
|
||||
_buffer.SetGlobalVector("_EffectFactor", new Vector4(toneLevel, 0, blur, 0));
|
||||
_buffer.GetTemporaryRT(s_EffectId2, w, h, 0, m_FilterMode);
|
||||
for (int i = 1; i < m_Iterations; i++)
|
||||
{
|
||||
@@ -292,7 +276,6 @@ namespace Coffee.UIExtensions
|
||||
{
|
||||
_buffer.ReleaseTemporaryRT(s_EffectId2);
|
||||
}
|
||||
_capturedIterations = m_Iterations;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +312,6 @@ namespace Coffee.UIExtensions
|
||||
RenderTexture _rt;
|
||||
RenderTexture _rtToRelease;
|
||||
CommandBuffer _buffer;
|
||||
int _capturedIterations = 1;
|
||||
|
||||
static int s_CopyId;
|
||||
static int s_EffectId1;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## [v2.4.1](https://github.com/mob-sakai/UIEffect/tree/v2.4.1) (2018-05-29)
|
||||
|
||||
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.4.0...v2.4.1)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- UIEffectCapturedImage: The result image is flipped vertically [\#69](https://github.com/mob-sakai/UIEffect/issues/69)
|
||||
|
||||
## [v2.4.0](https://github.com/mob-sakai/UIEffect/tree/v2.4.0) (2018-05-21)
|
||||
|
||||
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.3.2...v2.4.0)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "UIEffect",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mob-sakai/UIEffect.git"
|
||||
|
||||
+35
-20
@@ -13,44 +13,52 @@
|
||||
|
||||
|
||||
# input release version
|
||||
echo -e "\n>> Start Github Release:"
|
||||
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
|
||||
echo -e ">> Package name: ${PACKAGE_NAME}"
|
||||
CURRENT_VERSION=`grep -o -e "\"version\".*$" package.json | sed -e "s/\"version\": \"\(.*\)\".*$/\1/"`
|
||||
read -p "[? release version (for current: ${CURRENT_VERSION}): " RELEASE_VERSION
|
||||
[ -z "${RELEASE_VERSION}" ] && exit
|
||||
|
||||
|
||||
# update version in package.json
|
||||
echo -e "\n>> Update version... package.json"
|
||||
git checkout -B release develop
|
||||
sed -i -e "s/\"version\": \(.*\)/\"version\": \"${RELEASE_VERSION}\",/g" package.json
|
||||
|
||||
|
||||
# generate change log
|
||||
TAG=v$RELEASE_VERSION
|
||||
git tag $TAG
|
||||
git push --tags
|
||||
github_changelog_generator
|
||||
git tag -d $TAG
|
||||
git push --delete origin $TAG
|
||||
# check unity editor
|
||||
UNITY_VER=`sed -e "s/m_EditorVersion: \(.*\)/\1/g" ProjectSettings/ProjectVersion.txt`
|
||||
UNITY_EDITOR="/Applications/Unity/Hub/Editor/${UNITY_VER}/Unity.app/Contents/MacOS/Unity"
|
||||
echo -e "\n>> Check unity editor... ${UNITY_VER} (${UNITY_EDITOR})"
|
||||
"$UNITY_EDITOR" -quit -batchmode -projectPath "`pwd`"
|
||||
echo -e ">> OK"
|
||||
|
||||
# generate change log
|
||||
CHANGELOG_GENERATOR_ARG=`grep -o -e ".*git\"$" package.json | sed -e "s/^.*\/\([^\/]*\)\/\([^\/]*\).git.*$/--user \1 --project \2/"`
|
||||
CHANGELOG_GENERATOR_ARG="--future-release v${RELEASE_VERSION} ${CHANGELOG_GENERATOR_ARG}"
|
||||
echo -e "\n>> Generate change log... ${CHANGELOG_GENERATOR_ARG}"
|
||||
# TAG=v$RELEASE_VERSION
|
||||
# git tag $TAG
|
||||
# git push --tags
|
||||
github_changelog_generator ${CHANGELOG_GENERATOR_ARG}
|
||||
# git tag -d $TAG
|
||||
# git push --delete origin $TAG
|
||||
|
||||
git diff -- CHANGELOG.md
|
||||
read -p "[? continue? (y/N):" yn
|
||||
read -p "[? is the change log correct? (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
|
||||
# commit release files
|
||||
echo -e "\n>> Commit release files..."
|
||||
git add CHANGELOG.md -f
|
||||
git add package.json -f
|
||||
git commit -m "update change log"
|
||||
|
||||
|
||||
# merge and push
|
||||
echo -e "\n>> Merge and push..."
|
||||
git checkout master
|
||||
git merge --no-ff release -m "release $TAG"
|
||||
git branch -D release
|
||||
@@ -60,8 +68,15 @@ git merge --ff master
|
||||
git push origin develop
|
||||
|
||||
|
||||
# export unitypackage
|
||||
PACKAGE_SRC=`node -pe 'require("./package.json").src'`
|
||||
echo -e "\n>> Export unitypackage... ${PACKAGE_SRC}"
|
||||
"$UNITY_EDITOR" -quit -batchmode -projectPath "`pwd`" -exportpackage "$PACKAGE_SRC" "$PACKAGE_NAME.unitypackage"
|
||||
echo -e ">> OK"
|
||||
|
||||
|
||||
# upload unitypackage and release on Github
|
||||
gh-release --draft --assets "$PACKAGE_NAME.unitypackage"
|
||||
gh-release --assets "$PACKAGE_NAME.unitypackage"
|
||||
|
||||
|
||||
echo "\n\n$PACKAGE_NAME v$RELEASE_VERSION has been successfully released!\n"
|
||||
echo -e "\n\n>> $PACKAGE_NAME v$RELEASE_VERSION has been successfully released!\n"
|
||||
|
||||
Reference in New Issue
Block a user