XNA Creators Club Online

sample details

Shader Series 2: Textures and Colors
Sample
submitted
5/24/2007

Description:

This sample shows how to combine texture operations with mathematical color operations to blend colors and achieve interesting lighting effects.

Sample Overview

This sample shows how to combine texture operations with mathematical color operations to blend colors and achieve interesting lighting effects. New features include HLSL textures and samplers, uniform boolean parameters to HLSL functions, and vertex colors.

The sample initially shows a common usage scenario for combining lighting, vertex color, and texture colors to create the final color output. Cycling through the available techniques will then show the individual elements, simple combinations, and finally alternative combinations of all three.

The most important lesson of this sample is that the manner in which you come up with the output color for a pixel is completely arbitrary. You may use colors derived from any number of sources and combine them any way you wish to achieve the effect you desire.

Other items in the Shader Series

downloads
Framework

GS 2.0

Vertex Shader Version

VS 2.0

Pixel Shader Version

PS 2.0

var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG