-
Notifications
You must be signed in to change notification settings - Fork 7
Reflection
The (Screen Projected) Reflection feature is a very powerful tool and can be used in many kind of ways that are not obvious at first glance. This Feature works by overlaying another Sprite/Texture and scrolling it with the GameObjects world position. Reflections can be also masked out and get perturbed by the active Curvature Normal Map.
You can use Sprites, Textures and Render Textures for reflections, cubemaps are not supported. One important consideration you need to take care of, is to make sure that the Textures Wrap Mode is set to Repeat. On a Sprite you do this by switching Texture Type to Advanced, there you will find the Wrap Mode option.
Set the strength on the reflections visibility. A value like 0.5f blends in the reflection halfway.
Blurs the Reflection. It essentially sets the Mip Map level on the texture.
You can scroll the reflection by the sprite's position in world space. This behaviour is intentional but you can turn it off by just setting X and Y to 0.
You can provide a grayscale texture to mask out the reflection.
Left: Mask - Right: Mask applied
Since Reflections gets perturbed by the Curvature we can archive a bunch of interesting effects. Consider the following examples:
Using a circular normal map will result in a Lens effect. Setting depth in the curvature settings to a negative value will invert the reflection and put it upside-down!
We can also make some kind of metal. Let's try this:
This looks certainly interesting but it's too noisy :-? We can fix this by setting the Blur on the Reflection to something like 5~7:
Perfect! =)
Alternatively to using Blur, you could also use an precomputed blurred/diffused sprite.