Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Unity 2017.2 beta is now available for download.
    Dismiss Notice

SDF Toolkit - Now Released

Discussion in 'Works In Progress' started by Jasper-Flick, Mar 26, 2015.

  1. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    236
    not an issue if it's just an emulator problem. If it works on the device I'm ok with that.
     
  2. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    778
    Practically all modern OpenGL ES 2+ devices support derivatives. If you specifically want to target ancient hardware, you'll have to use a material with manual smoothing and without supersampling. Supersampling isn't a great idea for mobiles anyway, as it's costly.
     
  3. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    236
    No. the problem was that this was the most latest api (25) where I faced this problem, not the old devices. You can try it by yourself. Enable virtualisation in bios then in android studio run AVD manager and create new device with latest android API. and then just make a build for android as you do when your device is conecte through USB but in this case build will go to the emulator.
     
  4. dearamy

    dearamy

    Joined:
    Mar 17, 2015
    Posts:
    43
    Is there any I can use some shader as a UI mask?
     
  5. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    778
    You can use the contour to shape the form of a material, but it doesn't work with Unity's UI masking. The Mask component uses the stencil buffer, using raw image alpha as a binary mask. Contours can work with a custom soft masking approach, but you'd have to set that up yourself.
     
  6. Malkyne

    Malkyne

    Joined:
    Nov 18, 2009
    Posts:
    32
    I was already using TextMesh Pro (which uses the same technique) for my text in a particular project, and I thought I might try this out, to see if it will do the same great thing for some larger icons that I didn't want to move into an icon font, since I wasn't really using them inline, anywhere.

    I was able to get some very nice results from this, for clean, simple icon outlines at many sizes. That part worked great, with no problems.

    However, since it seems to ignore the Image Color, I haven't been able to figure out a way to independently vary the colors of icons that use the same material. I don't really want a separate draw call for every single icon color I might want to use on the screen at once. Did I miss a sneaky trick to make this work, or is it just not supported, at this time?
     
  7. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    778
    Sprite coloring in Unity's UI is done via vertex colors. You can enable vertex colors for the first and/or second contour via the checkboxes on the albedo material property lines in the material inspector. You can also just use the albedo texture.
     
  8. Jake-L

    Jake-L

    Joined:
    Oct 17, 2009
    Posts:
    396
    Just a quick question: Does it work with 3D, i.e. highlighting edges by a certain angle treshold?
     
  9. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    778
    It works with SDF textures. It isn't a post-processing effect.