Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

3D text shader with glow.

Discussion in 'Shaders' started by dorpeleg, Jun 27, 2013.

  1. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    Hello Community!

    I'll start by saying: I know nothing about shaders, so don't expect me to understand anything you say :p

    I need a shader that I can apply on 3D text.

    I need the shader to give me the same glow options like in photoshop (color, intensity, etc).

    I looked around and all I could find was this post:

    http://forum.unity3d.com/threads/95722-3D-Text-glow-effect

    This way of doing it will not work for me.

    So I'm here to ask for help.

    If you can help, I whould love you forever :D
     
  2. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    If you've got Unity Pro you could use an Image Effect (either the one thats included with Unity, or if you need more control one of the Glow effects on the Asset Store).

    If you're using the free version of Unity you're out of luck.
     
  3. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    I have pro.

    How will I go about applying the glow only to the text? (not very familiar with image effects).

    Are you sure this can't be done with a shader?
     
  4. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    With the glow effect that comes with unity that isn't possible. You could try to render the Text with a seperate camera and apply the Glow only to this camera.

    The main reason why there are glow effects on the Asset Store is because they allow you to control which objects should glow.


    It can't be done with a shader (unless it's used in a post effect). A shader can only affect pixels that are part of the rendered mesh and a glow should be much wider then the actual mesh.

    You could get some decent glow when using something that uses Bitmap fonts and embed the glow into the font bitmap (thought that will cause issues when the glow of the seperate characters overlaps).


    Did a quick test with my glow Shader (should note here that the version available in the Asset Store doesn't include a shader for fonts at the moment. So if anyone who has bought my glow wants it please contact me).
    $Screen Shot 2013-06-28 at 3.55.54 PM.png
     
  5. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    This looks like what I want.

    Can you post an image showing this glow with very high intensity? (so high that it wont look like a glow but like some sort of outline)

    How much does this shader costs?
     
  6. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    $Screen Shot 2013-06-28 at 5.21.06 PM.png

    at the moment it's $30
     
  7. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    Maybe it would be a good idea if you would post a picture (created with photoshop) showing what you want to achieve.
     
  8. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    That looks like what I need.

    I'll talk to my team lead and see if we are willing to buy it.

    It's on the asset store right?
     
  9. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
  10. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    This is what I'm looking for:
    $text example.jpg

    Its not even a glow but an outline (our artists made it with a glow effect set to full).
    I need the same outline effect on a 3d text.
    Any ideas?

    We are probably not gonna buy anything, so any known shader or leads to get the same effect will be most welcome
     
  11. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    Ok, for the lack of other solutions, we decided we are interested in buying the shader.

    But we have a few questions:

    1. Does this work with dynamic Text Mesh? (our text can be changed\updated at runtime)
    2. Does it work on common mobile devices (iOS, Android, Windows)?
    3. The implementation of the shader on the Text Mesh will not cost extra, right?
    4. Can I make the glow non-transparent (outline like)?
    5. Can I make the glow non-gradient (transparent-outline like)?

    Thanks.
     
    Last edited: Aug 6, 2013
  12. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Why dont you just use a simple pre-created texture on a plane object instead.
     
  13. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    The text needs to be dynamic.

    I tried the bitmap font way, didn't provide the desired results.
     
  14. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    First of all I've to say that I wouldn't recommend using the glow for an outline.

    to answer your questions:
    1. yes
    2. yes
    3. it's a image effect, so it's quite expensive
    4 and 5 are special, both are possible, but it would be a global setting and you would not be able to change the setting per text mesh, .

    but with there would be another issue with the shader as it is at the moment. It would also affect the text itself (but that would be easy to fix).


    i would really advise against using the glow for your use case. If I wanted to do an outline like that I would do it like this:
    1. create TWO bitmap fonts. one containing the plain chartacters, one containing the outline (maybe not just the outline, but also the "inner" part too)
    2. render the text with the outline font.
    3. render the text with the normal font on top of that.
     
  15. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    I'm not sure if you are talking about the price (will cost more then 30$?) or in terms of performance.

    What do you mean by "affect the text itself"?


    Manually creating bitmap font will take too long (setting up the custom font in unity).

    If I take the font I want and "make editable copy" and then edit the texture, I'm losing the "font size" option and therefore cannot do the "big font size - small scale" trick to get the font looking sharp.

    So I'm getting a blurry font.

    I'm guessing it's a modification to the shader.
    So If you make different copies of the shader, wont it be possible to have a different effect for each text?
     
  16. SRH

    SRH

    Joined:
    Feb 28, 2011
    Posts:
    160
    I'm talking about the performance.

    The "outline" should only be behind the text, but the glow is on top of it

    Use something like 2D Toolkit to render fonts in bmfont format. There are many tools to create such fonts (automatically from normal font files).

    Not possible at the moment. Also this would really kill the perofrmance on mobile devices.
     
  17. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    Thanks for the reply.

    We found a different solution eventually.
     
  18. RC-1290

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    639
    I assume you ended up using an outline effect, but perhaps it's nice for future Googlers to mention what you ended up using.
     
  19. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    Sure, I did not find an outline effect for text.

    What I ended up using was TTFText (70$ in the asset store).

    Yes, it's completely different because its actual 3D text, but we decided it will not only provide us with the outline look we needed, but it can also give us a lot of text animation options, which we also needed.