Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

[RELEASED] MK Glow

Discussion in 'Assets and Asset Store' started by Wraithes, Mar 29, 2019.

  1. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    hey,
    sadly out of the box this is not possible, because there is no emissive text mesh pro shader (not even an option for a hdr color)

    What actually works:
    1) Open the TMP_BaseShaderGUI.cs
    2) Go to ~400 and find the DoColor function
    3) Init replace the ColorField line with the folowing:
    Color value = EditorGUI.ColorField(EditorGUILayout.GetControlRect(), s_TempLabel, property.colorValue, true, true, true);

    After that your font color can be used as an hdr color, which gives you some kind of emission you can use to make the text glow.

    This way you dont have to modify the shaders itself or write a custom one.
     
  2. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    Well. I haven't used TextMesh Pro, yet. Seems like maybe I shouldn't.

    Here's what I really want to do: I want to be able to embed an image in text and make it glow. I noticed you have a text asset. Would that be a better out-of-the-box experience?

    I don't mind coding, of course, but I don't like hacking up a 3rd party asset.

    It might be cheaper for me to write a script that creates spaces, measures the locations of those spaces, and uses that information to set the position of an image...
     
  3. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    If you are using the builtin UI Text then you could simply apply the MK/Glow/UI/Default to your material. This shader has an emissive Color, which you can simply raise to make the text glow.

    I just did some test using Textmesh pro. Whats also working: After creating a new material based on a tmp preset you can change the "_FaceColor" Color Property via (editor)script to apply any hdr color.
     
  4. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    Yep. You can even do that in the GUI. Thanks!
     
  5. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    Although I'm interested in how you did that programmatically as I seem to be breaking the target materials.
     
  6. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    To be clear, I guess I'm setting it correctly but I'm failing to read it out of the MK Glow material (default UI shader), somehow.
     
  7. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    I see. Copy "_Color" to "_FaceColor". For someone else who wants to do this:

    Code (CSharp):
    1.   static void CopyHdrColor(Material Source, Material Destination)
    2.   {
    3.     if (!Source) return;
    4.     if (!Destination) return;
    5.  
    6.     Debug.Log(Source.color);
    7.     Destination.SetColor("_FaceColor", Source.GetColor(@"_Color"));
    8.   }
     
  8. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    Nope. That didn't copy the emission stuff. Trying to poke values into the glow settings is not working out and, even if it did, I would have to create a mapping between what MK Glow means by a value and what TMP means.

    I'll shut up now because nothing I'm trying is working. I'm trying to get text presented in TextMesh Pro to look exactly like all the other text in my UI, with the nice, clean, soft glow that is offered by MK Glow. I think this is basically impossible. So, if I want to embed images in text, I have to choose: Give up MK Glow so I can use TextMesh Pro or figure out how to make it look like an image is embedded in text, myself.

    You never answered my implied question about whether or not I could do what I want with EasyText and now I see why: It's a different "MK" (MasterKey).

    Right now, I think the answer is dump TMP and figure how to how to align an image with my text so that it looks like it's a part of said text. We're just talking about some in-game currency symbols. It shouldn't be too hard.

    Thanks for your help.
     
  9. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    I got it and it's actually super easy!
    1. Make the TMP control.
    2. Add a mask to it.
    3. Turn off "show mask graphic"
    4. Add an image with no sprite and a white tint as a child to the TMP control.
    5. Set the material of the masked sprite.
     
  10. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    Dang it. That still doesn't work when you have an embedded image because it creates two meshes. TMP seems pretty hacky to me. I'll see if I can just use a horizontal layout, some text, and an image, instead.
     
  11. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    well, yeah i thought your main problem was the glow.


    On the mk glow default UI shaders the emissive color is named: "_EmissionColor"
     
  12. MaxGuernseyIII

    MaxGuernseyIII

    Joined:
    Aug 23, 2015
    Posts:
    315
    Yes. MK Glow is easy to understand and use.

    It's TMP that seems designed to block us at every turn.
     
    Wraithes likes this.
  13. K0ST4S

    K0ST4S

    Joined:
    Feb 2, 2017
    Posts:
    25
    Hello there. Where is the Volume Component that you mention in the last step of setting up for URP?
     
  14. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    Hey there,
    On the URP the Volume Component (built-in pipeline component) is used for Postprocessing. Normally you have at least one in your scene. On this component you should be able to add MK Glow as an override.

    all the best
    Michael
     
  15. K0ST4S

    K0ST4S

    Joined:
    Feb 2, 2017
    Posts:
    25
    Okay thanks. How to make specific layers glow without using Selective with URP? Currently when I select it I get this error:
    upload_2020-10-26_9-41-34.png
     
    Last edited: Oct 26, 2020
  16. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    Hey again,

    Regarding Selective Workflow:
    It was based on the replacement rendering feature, which seems now more or less be deprecated. The scriptable renderpipelines do not call this feature anymore and therefore it can't be supported. Thats also the reason why it will be removed in some future version of MK Glow.

    Regarding layers:
    I'm not sure if its possible on the URP to layer postprocessing effects to specific layers to be honest. On the built-in renderpipeline this was kind of possible if you set one camera as an addive layer via clearFlags. Since the URP is such a weak renderer i guess its not possible without any hacks.

    Whats actually works:
    On Threshold Workflow: Set the threshold to a value of ~1.25 (or maybe higher) and just raise the emission on specific objects you get kind of a similar selective feeling.
    On Natural Workflow: Since here is no threshold or color cutoff you could simply lower the intensity of the effect and raise the emission of the specific materials.

    Regarding your error:
    This looks really engine related rather than related to mk glow. If this issue is reproduceable and related to mk glow it would be super helpful if you could simply drop me a message via support email and send me over a simple example package which contains this issue. Then i'll take a look into it as soon as possible.

    all the best
    Michael
     
  17. ToxMox

    ToxMox

    Joined:
    Jul 23, 2020
    Posts:
    15
    How do I prevent the install wizard from constantly opening everytime the project rescans assets?
     
  18. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    Right after you clicked the import package button this behavior should be disabled (maybe you imported the package again after you installed it already). Otherwise: Inside the MKGlow/Editor folder you should find a "Configuration" asset which has a "Show Installer On Reload" toggle, simply disable it.
     
  19. ZhekunWang

    ZhekunWang

    Joined:
    Mar 1, 2021
    Posts:
    1
    how do you even use this in unity...I'm using unity unity 2020.2 URP. The package I downloaded is the the MK glow 39.99$ one, and it came with an instruction sheet. I and I can't add custom renderer feature as it says for URP! And where is the volume thing ...
     
  20. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    Right after you imported the package an install wizard should open. Select Universal as a renderpipeline and click the import package button.

    After that:
    1) On your Forward Renderer Asset (by default located inside the Assets/Settings Folder) click the Add Renderer Feature button and add the MK Glow Renderer Feature.
    2) On your postprocessing profile (Volume Profile called in the URP) click the Add Override Button and add Post-processing/MK/MKGlow. In the URP example scene you have "Post-process Volume" object which has a Volume Component (something you have to create for postprocessing in your own scenes) where you add your volume profile (can also be created via rightclick on your assets folder/Create/Volume Profile).

    Also highly recommend:
    Enable HDR on your Universal Render Pipeline Assets. By default there are 3 created inside the Assets/Settings folder. Make sure to enable on every of them HDR using Quality => HDR. This is especially useful for things like glow/bloom.

    Once everything is set up simply raise the emission of your materials.
     
  21. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    92
    Is it possible to set only one object glowing, in HDRP, and leave rest of the scene unaffected? If MK Glow is added to HDRP global Volume it affects everything of course. I guess you wrote somewhere that there is no way to use layers to achieve this...?
     
  22. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    Sadly its not possible without any overhead (even with the now legacy Selective Workflow). I'm already experimenting with some alternatives regarding this case, but nothing felt smooth to use right now... So the best way right now is to filter the scene using the global intensity (natural workflow) and the threshold (threshold workflow).
     
  23. Tkara

    Tkara

    Joined:
    Dec 6, 2013
    Posts:
    2
    Hi! Love MKGlow! First time using URP. I'm making a VR demo for my Oculus Quest 2. I created a new project, added OpenXR plugin, XR Interaction Toolkit, and MKGlow Lite according to the instructions. I have added nothing to the default scene except for the XR Rig. As soon as I hit run and turn my head, the edges of the view/screen start glowing and slowly get worse like in attached image. It goes away if i disable MK Glow renderer feature. Is this a bug, or am i doing something wrong? Thanks!
    Unity 2020.2.1f1
    URP_Glare.png
     
  24. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    Hey there & sorry about the issue you get,
    sadly i can't help you in that case. With the update of the URP version for 2020.2+ (earlier versions should work as intended) something internally has changed about the XR rendering, which broke the XR compatibility completely. As far as i broke it down its something about the rendered XR Occlusion Mesh and i assume a stencil buffer or a rendertarget is not cleared correctly (this issue is also reproduceable if you port the builtin bloom onto the scriptable renderer feature, which is our only option for custom prostprocessing effects).
    I also pointed it out on the public trello board: https://trello.com/c/yLGn1lrj/144-20202-on-urp-xr-cant-be-supported-right-now (will update the compatibility section of the product description to make it more clear)

    If you bought the shader especially for the specific project feel free to drop a message via email (in that case i could offer you a refund at least).

    all the best
    Michael
     
  25. Tkara

    Tkara

    Joined:
    Dec 6, 2013
    Posts:
    2
    Thanks! I appreciate the response. I don't need a refund. I just wasn't sure if it was my own error or a problem with the plugin, or in Unity. I don't need any specific version of unity right now, since I'm just making stuff for myself for fun. I've used MKGlow in multiple projects in the past, and I can just use an older version of unity or a different render pipeline for now. I'm just glad you're aware of the issue in 2020.2+, and maybe if someone else is having the same issue, they'll see this post.
    Thanks again! MKGlow is a great asset!
     
  26. Wraithes

    Wraithes

    Joined:
    May 14, 2013
    Posts:
    52
    hey, glad you like the shader!
    feel free to drop me a message at any time if you need some further assistance. The issue will be fixed as soon as possible (hopefully we get a proper postprocessing framework in the future for URP).

    all the best
    Michael
     
unityunity