Sun Shafts image effect
Manual     Reference     Scripting   
Reference Manual > Components > Image Effect Scripts > Sun Shafts image effect

Sun Shafts image effect

The Sun Shafts image effect is a powerful technique to create radial light scattering such as god rays or light beams that are originating from a very bright light source.

As with the other image effects, this effect is only available in Unity Pro. Make sure to have the Pro Standard Assets installed.


Example for Sun Shafts.

Properties

Depth textureThis option can be used when no depth textures are available or too expensive to calculate (e.g. in forward rendering with plenty of objects). If this option is disabled it is required that the Sun Shafts effect is the very first image effect of a camera.
ResolutionThe used resolution. Lower resolutions are faster to calculate and create softer results.
Sun TransformThe transform of the light source that casts the Sun Shafts. Only the position is important (see Radius).
Distance and Align to viewport centerPlace the Sun Transform along a ray from the center of the game view camera.
Sun colorThe tint color of the shafts.
RadiusThe radius that defines the area around the sun transform that can cast sun shafts.
Blur offsetThe length of the generated sun shafts.
Blur iterationsThe iterations for creating sun shafts. More iterations will generate smoother and longer light beams but are also more expensive to calculate.
IntensityThe brightness of the added Sun Shafts.
Use alpha maskDefines how much the alpha channel of the color buffer should be used when generating Sun Shafts. This is useful e.g. when your skybox has a proper alpha channel that defines mask (such as clouds).

Hardware support

Bloom and flares effect works only on graphics cards with support for pixel shaders (2.0) or devices with OpenGL ES2.0 support. Eg. GeForce FX 5200 or Radeon 9500 and up. All image effects automatically disable themselves when they can not run on an end-users graphics card. Depth texture support is only required when the Use depth texture option is enabled.

Page last updated: 2010-09-09