Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    328
    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:
    801
    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:
    328
    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:
    67
    Is there any I can use some shader as a UI mask?
     
  5. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    801
    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:
    801
    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:
    397
    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:
    801
    It works with SDF textures. It isn't a post-processing effect.
     
  10. dearamy

    dearamy

    Joined:
    Mar 17, 2015
    Posts:
    67
    Screenshot_2.png I just got a whole bunch of errors when importing the package into Unity2018.1.5.
     
  11. Jasper-Flick

    Jasper-Flick

    Joined:
    Jan 17, 2011
    Posts:
    801
    The errors are caused by breaking changes to Unity's lighting macros for additive lights for the default pipeline. If you're not using forward rendering with additional lights, you can ignore the errors, or ideally remove the additive light passes from the shaders. I'm working on a fix.