Game Development Reference
In-Depth Information
making them appear to glow. You can alter its
Blur Radius
and the
Intensity
,
while the
Luminance Threshold
determines how bright an area needs to be
before the bloom effect is applied.
Refraction, Reflection, and Glass
are complex effects requiring a Normal
Map, which is an image where each pixel's RGB values are considered the
normal vectors. In layman's terms, the Normal Map image alters how light is
supposed to refract or reflect from the surface. All three effects also use an
Environment reference, which is one or more nodes that should be seen re-
flected in the
Effect
node. (See
Figure 12-10
.)
Figure 12-10
.
The glass effect distorts the background like a lens while slightly reflecting the Environment
node on its surface
The
Effect
node is very powerful, but the more complex effects require some understand-
ing of graphics and shader programming to grasp the meaning and to imagine the result-
ing effects of the various parameters.
The programming interface of
CCEffectNode
and
CCEffect
and related classes
hasn't been made available to the public while I'm writing this and is still a work in pro-
gress. Of course, you'll eventually find these classes documented in the Cocos2D
Developer Library Reference (also known as a
class reference
), and you can always peek
into the header files
CCEffect.h
and
CCEffectNode.h
.
Shader-Effects Best Practices
Search WWH ::
Custom Search