Thursday, July 9, 2009

Grayscale Conversion

예전에 RGB color가 Grayscale로 전환 시킬때 쓰이는 값 (0.222, 0.707, 0.071)이 어떻게 나온 것인지 참 궁금했었는데 이제야 해소가 된것 같다.

Consider the common conversion from RGB color to a grayscale. There are several approaches available: We can choose one color channel, or evenly blend all three channels, or mix the three RGB channels by varying weights to achieve a final grayscale result. The third choice, blending by weights, is generally accepted as the best, and it can be set to match the sensitivity of typical human eyesight.
We can express this blending with a dot product:
float grayscale = dot(float3(0.222, 0.707, 0.071), inColor);
The values (0.222, 0.707, 0.071) represent the relative scales for red, green, and blue, respectively. These numbers follow an international industrial color standard called ITU Rec 709 (there are actually a number of alternate formulations). Note that the components of the float3 vector used for this conversion sum to 1.0—this makes the conversion nominally "energy conserving," though in fact you can assign almost any values and get different interesting results, much as you can with the Photoshop Color Mixer tool.
In particular, a standardized conversion such as the one just described means that the brightness of pure colors may be limited—bright pure blues, for example, will never appear as more than a dark 7 percent gray. For artistic reasons, therefore, we may often want to vary the weights of our grayscale conversions, so that important colors aren't needlessly suppressed.
We can also use the results of such a grayscale conversion as a texture index to create alternative color mappings, using color-lookup textures similar to the one used in the previous section. Consider this mapping:
float grayscale = dot(float3(0.222, 0.707, 0.071), inColor);
// set the texture's edge-addressing to "clamp"

float3 OutColor = tex1D(ColorCorrMap, grayscale);
Using a grayscale-to-color-gradient mapping in this way permits us to create a wide variety of false-color and toned-print effects, both naturalistic (such as duotones or tritones) and highly stylized (such as robot vision or infrared "heat signatures" à la the movie Predator).

Storytelling through lighting.

Lighting is an important aspect of computer cinematography, in which lights and shadows are used to convey mood and support storytelling. Although realism remains an important aspect of computer-generated imagery, lighting directors constantly cheat the physics of light to support the artistic depiction of animated movies. Performing these tricks on a real-world set is a daunting task that often requires hours of setup. Freed of the limitations of real physics, developers of computer cinematography have been devising lighting models that let artists illuminate scenes intuitively.

The following six lighting objectives are important fundamentals of good lighting design.

• Directing the viewer’s eye
• Enhancing mood, atmosphere and drama
• Creating depth
• Conveying time of day and season
• Revealing character personality and situation
• Complementing composition



[references]
http://www.ronenbarzel.org/papers/lighting.pdf
http://education.siggraph.org/resources/cgsource/instructional-materials/archives/courses/s96-c30/s96_course30.pdf

Wednesday, July 8, 2009

Free great computer graphics books from Nvidia