Closed slacker-jake closed 5 years ago
Hi @jakeslack27 Thank you for using this plugin!
You want to use your custom material and shader on UIEffect component, right?
Thank you for the fast response! That is right, I'd like to use a custom shader that has ZTest set to true so I can do overlay variety
Oh, I see. Wait a minute!
At the moment, UIEffect does not support it. In order to use a custom material, try following steps.
UIDissolve.cs
to prevent the change of effectMaterial.
protected override Material GetMaterial()
{
if (isTMPro)
{
return null;
}
return m_EffectMaterial; // ADD THIS LINE
// return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName), m_ColorMode); // REMOVE THIS LINE
}
Effect Material
in inspector view (Debug mode.)
ADD
in inspector view (Debug mode) to use additional color mode.
I will implement this feature in the near future. :)
Hi,
I have tried following your instructions but unfortunately it doesn't seem to work for me. The initial change of the material works but as soon as I save the scene/apply prefab/play the scene my UI.Image component resets to the default material. Any additional step that could prevent that from happening?
Thanks, Jake
Hi @jakeslack27 Ok, I will test it later.
ありがといございます!
On Tue, 2 Jul 2019, 18:22 Takashi Sakai, notifications@github.com wrote:
Hi @jakeslack27 https://github.com/jakeslack27 Ok, I will test it later.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mob-sakai/UIEffect/issues/175?email_source=notifications&email_token=AE42HHJDKPYFOP5ZQSVZOVLP5MM43A5CNFSM4H4L5Z2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZAUVUY#issuecomment-507595475, or mute the thread https://github.com/notifications/unsubscribe-auth/AE42HHOFW27ATCYK5AR5KPLP5MM43ANCNFSM4H4L5Z2A .
Hi Takashi san, any update on this!?
Thanks!
Jake Slack Software Developer
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
On Tue, Jul 2, 2019 at 6:23 PM Jake Slack jake.slack@synertial.com wrote:
ありがといございます!
On Tue, 2 Jul 2019, 18:22 Takashi Sakai, notifications@github.com wrote:
Hi @jakeslack27 https://github.com/jakeslack27 Ok, I will test it later.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mob-sakai/UIEffect/issues/175?email_source=notifications&email_token=AE42HHJDKPYFOP5ZQSVZOVLP5MM43A5CNFSM4H4L5Z2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZAUVUY#issuecomment-507595475, or mute the thread https://github.com/notifications/unsubscribe-auth/AE42HHOFW27ATCYK5AR5KPLP5MM43ANCNFSM4H4L5Z2A .
Hi @jakeslack27 Sorry for my late reply.
That's strange. It seems like its working for me... Hmm, maybe you have set your material to Image.Material?
If so it is wrong. Set your material to UIDissolve.EffectMaterial.
Sorry I'm a little confused.
When I set the material in UIDissove.EffectMaterial & the material in Image.Material to the correct material like so:
As soon as I hit Play or apply the prefab it resets to a hidden material I don't want to use:
What am I missing?
Perhaps there is an easier way to achieve what I want to do? I simply want a small change in some of my UIDissolves to have their ZTest set to Always.
OK @jakeslack27 There is a simple solution (with small changes) for that. It use shader keyword.
Just a moment please.
Add code as following:
[Tooltip("Compare function.")]
[SerializeField] UnityEngine.Rendering.CompareFunction m_CompareFunction;
hash += ((ulong)m_CompareFunction << 38);
mat.SetInt("unity_GUIZTestMode", (int)m_CompareFunction);
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_CompareFunction"));
NOTE: This solution does not require an extra shader.
Awesome :)
Thank you so much for your help - I've managed to get the overlay working. However, there are two minor issues still remaing before I have the super, beautiful level of polish I'm looking for.
No occlusion
With occlusion
Oh, that's a beautiful scene. :) Just a moment please.
Hmm, CanvasGroup.alpha does not affect UIEffect. It is a bug.
ありがとうございます :)
Let me know if I can do anything to help? 私を手伝てくれてありがとう!
Jake Slack Software Developer
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
On Fri, Jul 12, 2019 at 9:22 AM Takashi Sakai notifications@github.com wrote:
Hmm, CanvasGroup.alpha does not affect UIEffect. It is a bug.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mob-sakai/UIEffect/issues/175?email_source=notifications&email_token=AE42HHOU2OIGSBGFLHKZKX3P67FCTA5CNFSM4H4L5Z2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZYKMUQ#issuecomment-510699090, or mute the thread https://github.com/notifications/unsubscribe-auth/AE42HHLUXI6IWRRWR3NQLOLP67FCTANCNFSM4H4L5Z2A .
@jakeslack27 It seems to be working fine. :) (Z test always and transparent)
If you need a material using another CompareFunction, duplicate the dissolve material and use it.
できた、よかった。ほんとにありがとうございます!
I’m happy to hear that :smile::+1:
This feature will be integrated in UIEffect v4.x :+1:
Hi,
I'm trying to use the effect to have a dissolve effect on my UI.Image component. This is working well except I would like to have two versions of the Image - one with ZTest set to false and another set to true (so when the object is occluded, you can see a faint version of the Image). However, when I try to use a different material/shader for the UIEffect it resets to the default. Is there a way around this?
Thanks, Jake