资源视图(VIEW)主要有两个功能 :1)告诉 Direct3D 如何使用资源 (即,指定资源所要绑的管线阶段 ); 2)如果在创 建资源时指定的是弱类型 (typeless )格式 ,那么在为它创建资源视图时就必须指定明确的类型 。对于弱类 ,纹理元素可能会在一个管线阶段中视为浮点数 而在另一个管线阶段中视为整数
当创建资源时 , 为资源指定强 类型 ( fullyfully-typed)格式 , 把资源的用途 限制在格式规定的范围内 ,有利于提高运行时环境对资源的访问速度 ……”
所以 ,你只应该在真正需要弱类型资 ,才创建弱类型资源 ;否则 ,应尽量创建强类型资源 应尽量创建强类型资源
The equation for specular lighting is the following:
SpecularLighting = SpecularColor * (SpecularColorOfLight * ((NormalVector dot HalfWayVector) power SpecularReflectionPower) * Attentuation * Spotlight)
We will modify the equation to produce just the basic specular lighting effect as follows:
SpecularLighting = SpecularLightColor * (ViewingDirection dot ReflectionVector) power SpecularReflectionPower
The reflection vector in this equation has to be produced by multiplying double the light intensity by the vertex normal. The direction of the light is subtracted which then gives the reflection vector between the light source and the viewing angle:
ReflectionVector = 2 * LightIntensity * VertexNormal - LightDirection
The viewing direction in the equation is produced by subtracting the location of the camera by the position of the vertex:
ViewingDirection = CameraPosition - VertexPosition