• Stars
    star
    2,017
  • Rank 22,948 (Top 0.5 %)
  • Language ShaderLab
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A sprite glow effect for Unity game engine

Installation

Use UPM to install the package via the following git URL: https://github.com/Elringus/SpriteGlow.git#package or download and import SpriteGlow.unitypackage manually.

Description

The glow effect is achieved using sprite outline in HDR colors (applied via shader) and bloom post-processing.

Glow Intensity Glow Color

For the bloom effect Unity Post Processing Stack (PPS) is used. You can replace it with similar 3rd-party solutions.

The effect is compatible with the Universal Render Pipeline (URP, aka LWRP). Bloom should be configured via URP's own post-processing solution; don't forget to enable HDR in the pipeline asset settings.

Character sprite by Mikhail Pigichka.

FAQ

Can I use the effect with components other than SpriteRenderer (UI Image, Tilemap, etc)?

Not directly (after all, this is SpriteGlow), but it's possible if the component is using a shader similar to sprites (e.g UI objects, tilemaps and other "2D" stuff). For this you will have to create a material based on the Sprites/Outline shader and manually apply it to the component. You can then control all the glow parameters using the material editor. In the project you can find scenes with the examples for applying the effect to UI Button and a tilemap.

Why doesn't the glow appear?

Make sure:

  • A bloom post-processing effect is enabled (you can use any, eg the one from Unity's PPS). Be aware, that universal render pipeline (URP/LWRP) only supports built-in post-processing, third-party solutions (including PPS) won't work with it.

  • HDR is enabled for target platform and tier (Edit > Project Settings > Graphics):

  • Camera 'Allow HDR' is enabled:

  • You've set 'Glow Brightness' high enough:

Why does the glow appear on the whole image?

Make sure 'Threshold' value of the bloom image effect is set high enough. It's usually 1 to 1.5, depending on the bloom solution.

Why do I get a NullReferenceException in build?

Most likely the outline shader is not included to the build (it happens when none of the included assets reference SpriteGlow component directly). You can force-include the shader by assigning it to the "Always Included Shaders" in Edit -> Project Settings -> Graphics.

It's still not working!

Make sure you're using a compatible Unity version; supported versions per release are available on the releases page.

Download (clone) this repository and examine the example scenes, comparing them with your setup. Chances are, you've misconfigured something.

In case nothing of the above helps, check the active issues or open a new one. Don't forget to include the full error log, detailed information about your system, Unity version, package version and steps required to reproduce the issue.

More Repositories

1

SpriteDicing

Unity extension for lossless sprite texture compression
C#
1,160
star
2

DotNetJS

Consume C# in JavaScript with comfort: single-file UMD library, auto-generated 2-way bindings and type definitions
JavaScript
592
star
3

grass-bending

A replacement for Unity's terrain grass shader with alpha blended rendering and touch bending effect
C#
515
star
4

UnityGoogleDrive

Google Drive SDK for Unity game engine
C#
362
star
5

UnityRawInput

Windows Raw Input wrapper for Unity game engine
C#
198
star
6

UnityConsole

Development console for Unity game engine
C#
79
star
7

BlendModeExample

Example project for "Blend Modes in Unity" article
ShaderLab
69
star
8

UnityCommon

A collection of common frameworks and tools for Unity-based projects
C#
68
star
9

iOSReviewRequest

Unity plugin to invoke a native iOS review request
C#
30
star
10

DarkMatterShader

VFX for Unity
ShaderLab
19
star
11

UnityStreamlabs

Streamlabs client for Unity game engine
C#
14
star
12

UnityDonationAlerts

DonationAlerts SDK for Unity game engine
C#
12
star
13

SagaGUI

GUI plugin for Unreal Engine 4
C++
11
star
14

haji-jam

A small stealth simulation game about social fobia
C#
3
star
15

WasmTest

An example on using .NET 6 Blazor without the ASP.NET web components overhead for JS interop
C#
3
star
16

UnityGoogleDriveAndroid

Used to build AppAuth-Android client library for UnityGoogleDrive project
Java
3
star
17

AddressableUnloadIssue

Repro project for Unity's addressable bug when Resources.UnloadUnusedAssets not unloading released assets
C#
3
star
18

excel-processor

Automate generation of simple pivot Excel spreadsheets
C#
3
star
19

ShadersStudy

Learning to write basic shaders
C
2
star
20

EnginesOfPlay

Interactive player motivation model
CSS
2
star
21

StarcorServer

Starcor project serverside
Python
1
star
22

UECursorBug

Bug with cursor widget being reset on level change
C#
1
star
23

Elringus

1
star
24

BlendModesTutorials

Tutorials project for the `BlendModes` plugin
ShaderLab
1
star
25

BlendModeLayered

GLSL
1
star
26

CDN

1
star
27

NightmareAcademy

HTML
1
star
28

ArabicFixerIssue

ShaderLab
1
star
29

PostProcessingStack

C#
1
star
30

Database

Generic database access layer
1
star
31

UnitySagaGUI

C#
1
star
32

TracesOfLight

A third person adventure game
C++
1
star
33

BiosorbEngine

Biosorb project server-side
1
star
34

StarcorPreAlpha

C#
1
star
35

WireStep

C#
1
star
36

QBubbles

Quantum bubbles game
C#
1
star
37

BreachedUnity

Old Unity-based version
C#
1
star
38

GaBug

A repro project for GA UE4 SDK packaging bug
C++
1
star
39

SagaNetwork

SAGA project backend
C#
1
star
40

ChatServer

Chat for the SAGA project
C#
1
star
41

PingBall

Ludum Dare 36 Warmup project
C#
1
star
42

CWalkerServer

Python
1
star
43

UnrealEngine

4.10.4 branch for Breached
C++
1
star
44

Unite

Logic puzzle game about numbers
C#
1
star
45

Saga

C
1
star
46

PrimeChainStalker

A console program for finding the longest increasing prime numbers chain in a bin file
C#
1
star
47

CWalker

Crazy walker game
C#
1
star
48

UeRtsCamera

A draft for generic RTS camera
C++
1
star
49

PostInitUMGBug

Repro project for the PostInitProperties bug in UE4
C++
1
star
50

DrawMaskIssue

A repro project for drawing sprite mask to render texture issue
C#
1
star