Đang chuẩn bị liên kết để tải về tài liệu:
Microsoft XNA Game Studio Creator’s Guide- P14

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Microsoft XNA Game Studio Creator’s Guide- P14:The release of the XNA platform and specifically the ability for anyone to write Xbox 360 console games was truly a major progression in the game-programming world. Before XNA, it was simply too complicated and costly for a student, software hobbyist, or independent game developer to gain access to a decent development kit for a major console platform. | 68 MICROSOFT X N A GAME STUDIO CREATOR S GUIDE float3 unitDirection normalize lightDirection L N.L - dot product of surface normal and light direction float cosine dot unitNormal unitDirection R 2 N.L N - L float3 reflection normalize 2 cosine unitNormal - unitDirection R.V n specular reflection. float specularLevel pow dot reflection unitDirection 2 specularColor color intensity specularLevel return specularColor The diffuse light is simply the dot product between the light direction vector and the object being lit. The dot product approaches 1 for full intensity with the directness of the light to the surface. When this calculation is done in the pixel shader the result is interpolated between pixels to produce a nice smooth-looking light. As you move the camera closer to the wall the light radiates brightly and fizzles outward from the point that is directly in front of the camera. Diffuse light is modeled by the following equation Diffuse Color Diffuse Intensity N.L To make the light fade from the center even more dramatic the light intensity is scaled with a fallOff variable. fallOff is the inverted exponent of the scaled distance d between the light and pixel. exp d equals ed where e is approximately 2.718281828. Because N.L cos a as the angle between the surface normal and light vector decreases cos a approaches 1 and diffuse light increases. Shining a light directly at a surface normal generates a brighter reflection than a light shone at an angle away from the normal vector. PointLightDiffuse calculates the color added by the diffuse light float4 PointLightDiffuse VStoPS IN unit direction of light vector L floats lightDirection normalize lightPosition - IN.transformedPosition brightest angle between L and N 0 float diffuseLevel dot lightDirection IN.normal get distance from light to pixel float distance distance lightPosition IN.transformedPosition 69 CHAPTER 22 I compute a falloff for the lighting float scale 0.2f float fallOff clamp 1.0f exp distance .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.