Graphics Reference
In-Depth Information
When performing the UV unwrapping process, it is important to consider the impact that
mip-mapping will have on the final render result as this can lead to color bleeding. Mip-mapping
is the process of sampling from lower resolution versions of a texture to control the level of detail
for objects that are further away. For example, if a UV coordinate borders two colors with little
room to wiggle at a lower resolution, the two colors may get blended together.
Mipmaps can be created for a DDS texture within the Visual Studio graphics
editor or at runtime when loading a texture by configuring the texture
description with the ResourceOptionFlags.GenerateMipMaps flag.
var desc = new Texture2DDescription();
...
desc.OptionsFlags = ResourceOptionFlags.
GenerateMipMaps;
Lighting
In our common shader file, we have implemented three lighting formulas.
The Lambert function calculates the diffuse reflection using Lambert's Cosine law,
while the SpecularPhong and SpecularBlinnPhong methods calculate the specular
reflection using the Phong and Blinn-Phong models respectively. Our pixel shaders then
combine the components for ambient light, emissive light, and diffuse, and in the case
of the two specular light models, specular reflection.
Blinn-Phong is a modification of the Phong reflection model that produces a slightly larger
specular highlight when using the same specular power as Phong. This can easily be
corrected by increasing the specular power when using the Blinn-Phong shader. The
Blinn-Phong shader generally produces more desirable results than the Phong method
(see http://people.csail.mit.edu/wojciech/BRDFValidation/index.html ).
Normal
View
Half
Light
Reflection
Surface
Unit vectors used in the calculation of Phong and Blinn-Phong specular reflection
 
Search WWH ::




Custom Search