The 3d model is applied to render the light source and can be implemented using the method under the Basiceffect class. This class can accomplish most of the complex rendering effects.
Lightingenabled--Sets whether to turn on light rendering. The default is false, that is, when the scene is rendered, use "a base light" a fixed light to illuminate each part of the object. If true, the effect of the lighting is used in the effect defined in Basiceffect.
enabledefaultlighting– uses the default light effect. If no light rendering is turned on, the function will also open automatically.
preferperpixellighting– turn on pixel light.
DirectionalLight0, DirectionalLight1, DirectionalLight2--Defines the directional light used when rendering. Each directional light contains parameters such as specular reflection, diffuse light, and direction of the light source. These properties are valid when the lightingenable is set to true.
Ambientlightcolor--The ambient reflection color of an object, expressed as a floating-point number between 1 and 0.
For lighting effects: it can be divided into pixel light and light by point.
Dot-per-point illumination: Is the default lighting, fast, slightly worse, for complex scenes.
Per-pixel illumination: slightly slower, the effect is good, for each pixel point for accurate color adjustment.
//固定的光照
effect.LightingEnabled = false;
//单向点光源
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = false;
effect.DirectionalLight1.Enabled = false;
effect.DirectionalLight2.Enabled = false;
//点光源
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = false;
//单向像素光源
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
effect.DirectionalLight1.Enabled = false;
effect.DirectionalLight2.Enabled = false;
//像素光源
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
Sample Download Address: http://www.52winphone.com/bbs/viewthread.php?tid=292&extra=page%3D1