Solaro Shaders, Part 2

December 15th, 2010| Posted by Andy Korth
Categories: Uncategorized | Tags:

This is part two of an overview of cool shaders we wrote for Solaro.

Title Distortion

We’ve also got a vertical distortion shader that we can apply to things like in game text, title images, and other billboard effects. Used here on the “Solaro” title, this shader creates a bit of a video interference effect… and again, it looks a lot better in action. We vertically scroll a very tall and wrapping 1×512 pixel normal map, and we use it as a distortion map. This creates a moving pattern over the image that shakes it to the left or the right. This effect can add a lot to an otherwise plain title or static image. The animation brings it to life with a digital sort of effect.

The target view shader is applied to the entire target camera. This inset camera is used to get a view of a targeted ship if it’s off screen. We create an animated noise grain over the image, as a sort of static effect. We also apply an edge burn texture around it, which helps visually differentiate the target view from normal space. Another nice effect of the target view shader is that it allows us to fade the view in and out smoothly. This allows for a seamless transition from a ship on the screen, to one that has moved offscreen and is now represented within a target camera box.

Our shield shaders are used in a few different places. This is our PlanarShield effect. It takes one base texture, but samples it twice at different points, each changing as a function of time. The resulting effect is a smooth wrapping animation of movement in the shield. When it’s applied to a sphere, you get a very cool plasma-like effect. This shader also modulates the intensity as a function the y position of the UV coordinates. With the way our sphere is unwrapped, this makes our shield more transparent at the top and bottom, so you mostly just see the shield around the edges of the circle. This allows you to still see your ship through the center of the shield.

We do a similar animation effect on our warp gates. However, we adjust the falloff differently so the visual effect is strongest at the center. This hides the y=0 line of UV coordinates at the center of the sphere, since it’s fully opaque there. You then see a swirling vortex animation centered around the middle of the warp gate.

All ships in Solaro are equipped with these deflector shields. They activate and pulse once each time you bump into a solid object with your ship. They have a similar animation, but they only show up at the point of impact. These last three images show how you can get a lot of milage from a custom shader with only a few changes.

Comments are closed.