Search Unity

[Released] GUI Shaders Pack

Discussion in 'Assets and Asset Store' started by MODev, May 24, 2018.

  1. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229

    Time has come for new great shaders pack on Asset Store: GUI Shaders Pack
    GUI Shaders Pack contains advanced and multi-property shaders prepared for GUI. Most of shaders work with both Unity Text and Image components.

    Shaders work on PC, Mobile, Console and VR devices. Most of shaders require shader model 3.0.

    Shaders:
    -Dissolve (burn as color or gradient)
    -Distortion
    -Glow control (requires bloom postprocess)
    -Hologram
    -Materialization (requires DX11)
    -Opaque (non-transparent, perfect for GUI optimization)
    -Color correction (gamma, saturation, contrast, brightness)
    -Blured (image)
    -Bluring (background)
    -Tween (set and animate GUI offset, rotation and scale by material)
    -Additive
    -Grayscale

    Supports:
    -Unity: 2018, 2019, 2020, 2021
    -Standard rendering pipeline
    -URP (without Bluring effect as it require grab pass)

    Available at: https://assetstore.unity.com/packages/vfx/shaders/gui-shaders-pack-117966

    New shaders ideas are also welcome! Maybe they will appear in next update.

     
    Last edited: Aug 28, 2021
  2. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    Version 1.1 released!
    What's there:
    -Color correction shader (gamma, saturation, contrast, brightness)
    -Blured image shader
    -Bluring background image shader
    -Tween (set and animate GUI offset, rotation, scale by material, what's great you can set same material to multiple images to animate them in the same tame with single material changes!)
    -fixed world space UV mappings for some noise textures

    Check out preview video part 2:
     
    Last edited: Jun 5, 2018
  3. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    Version 1.2 released, what's new:
    • Additive shader
    • Burn to another color shader
    • Grayscale shader (with progressive mode)
    • GUI Standard lightened shader (works similar to 3D Unity Standard shader)
     
  4. btyson_z

    btyson_z

    Joined:
    Aug 10, 2018
    Posts:
    9
    Can the values in these shaders be keyframed in the animation timeline?
     
  5. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    Hi,
    basically Unity doesn't allow in Animation edit material values (don't know why). But you can use script like this to make animation support value changes (just set property name and change this script values by Animation timeline):
    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.UI;
    6.  
    7. /// <summary>
    8. /// Image material property setter usefull for Animation use
    9. /// </summary>
    10. [RequireComponent(typeof(Image))]
    11. public class ImageMaterialProperty : MonoBehaviour
    12. {
    13.     public string materialPropertyName = "_Progress";
    14.     public bool instantiateMaterial = true;
    15.  
    16.     [SerializeField] public float floatVal;
    17.     [SerializeField] public Vector4 vectorVal;
    18.     [SerializeField] public Color colorVal;
    19.  
    20.     private Image image;
    21.     private float oldFloatVal;
    22.     private Vector4 oldVectorVal;
    23.     private Color oldColorVal;
    24.  
    25.     protected void Awake()
    26.     {
    27.         image = GetComponent<Image>();
    28.         if(instantiateMaterial)
    29.             image.material = new Material(image.material);
    30.         oldFloatVal = floatVal;
    31.         oldVectorVal = vectorVal;
    32.         oldColorVal = colorVal;
    33.     }
    34.  
    35.     protected void Update()
    36.     {
    37.         if(floatVal != oldFloatVal)
    38.             image.material.SetFloat(materialPropertyName, oldFloatVal = floatVal);
    39.  
    40.         if(vectorVal != oldVectorVal)
    41.             image.material.SetVector(materialPropertyName, oldVectorVal = vectorVal);
    42.  
    43.         if(colorVal != oldColorVal)
    44.             image.material.SetColor(materialPropertyName, oldColorVal = colorVal);
    45.     }
    46. }
    47.  
    In package you can also find script which can be triggered by animation to change progress values over time (shaders have option for animating their colors, offsets, etc. by just changing single _Progress property)
     
  6. nankink

    nankink

    Joined:
    May 6, 2017
    Posts:
    15
    Hi! I'm looking for a dissolve effect and got very interested after finding yours in the asset store.
    But my project is currently using URP. I see that in the description it says Standard render pipeline, but is there any chance of being usable in URP?
     
  7. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    Hi @nankink, I've just checked and most of GUI Shaders Pack effects work on URP on 2020 version (2021 and 2019 probably too). Only effects which use postprocess grab pass like Bluring does not work. I think we will update information on asset store that URP is supported with certain exclusions. About dissolve effect: yes it's working fine on URP.
     
    nankink likes this.
  8. nankink

    nankink

    Joined:
    May 6, 2017
    Posts:
    15
    Thank you very much! I'll talk to my team about it!
     
    MODev likes this.
  9. DrSkipper7

    DrSkipper7

    Joined:
    Apr 18, 2017
    Posts:
    13
    Hey there @MODev ! My team is interested in using GUI Shaders Pack in our project, but upon importing it I'm getting an error that prevents compliation. Specifically
    Assets\Plugins\GUIShadersPack\Scripts\Editor\GUITweenShaderEditor.cs(73,11): error CS0117: 'Handles' does not contain a definition for 'DrawSphere'


    There are also several warnings regarding deprecated methods and such. We are using Unity 2021.1.20f, and I noticed the latest update for GUI Shaders Pack says it added support for Unity 2021. Maybe there's been an update to 2021 since then though that broke things? Either way thought I'd let you know and see if you have any ideas!
     
  10. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    Hi @DrSkipper7 thank you for information! Accidentally we hadn't pushed package with 2021 version (we do this now).
    If you need instant fix please replace code in this line for:
    Code (CSharp):
    1.  
    2. #if UNITY_2021_1_OR_NEWER
    3.         Handles.SphereHandleCap(0, pivotPos, Quaternion.identity, handleSize * 0.1f, EventType.Ignore);
    4. #else
    5.         Handles.DrawSphere(0, pivotPos, Quaternion.identity, handleSize * 0.1f);
    6. #endif
     
  11. DrSkipper7

    DrSkipper7

    Joined:
    Apr 18, 2017
    Posts:
    13
    MODev likes this.
  12. oliver_unity892

    oliver_unity892

    Joined:
    Oct 28, 2019
    Posts:
    91
    I'm getting this error on 2020.3.5f1.

    Any ideas why that would be?
     
  13. oliver_unity892

    oliver_unity892

    Joined:
    Oct 28, 2019
    Posts:
    91
    Hi
    The demo scenes don't appear to be rendering correctly in the Game window. The camera is also missing a script.

    See screenshots. Any ideas?


    2021-11-15 21_33_36-Ship 57 - GUIExamplePreview - Android - Unity 2020.3.5f1 Personal_ _DX11_.png 2021-11-15 21_32_40-Ship 57 - Microsoft Visual Studio.png
     
  14. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    Hi,
    That's because of the same issue like few posts above. We will update script in asset store although if you don't want to wait please replace the issue code with:
    Code (CSharp):
    1. #if UNITY_2020_3_OR_NEWER
    2.         Handles.SphereHandleCap(0, pivotPos, Quaternion.identity, handleSize * 0.1f, EventType.Ignore);
    3. #else
    4.         Handles.DrawSphere(0, pivotPos, Quaternion.identity, handleSize * 0.1f);
    5. #endif
     
    oliver_unity892 likes this.
  15. oliver_unity892

    oliver_unity892

    Joined:
    Oct 28, 2019
    Posts:
    91
    Thanks MoDev. Any ideas about the missing script on the demo scenes? Which script should be on the camera? I'm keen to see the demo scene working.
     
  16. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    @oliver_unity892 The missing script is Unity's Postprocessing Behaviour (for bloom effect). Probably you have another version of postprocessing stack or even disabled or you are using your custom one. This is just an example so you can any kind of bloom for UI if needed
    upload_2021-11-16_17-55-7.png
     
  17. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Great asset, how is performance on mobile and on URP?
     
  18. MODev

    MODev

    Joined:
    Jul 30, 2013
    Posts:
    229
    @EmeralLotus it depends on effect type bug generally they are made with mobile and performance in mind. Personally I've used most of those effect on mobile game which I'd worked on (of course not those which require grab pass or dx11) and they were great.