照明Lighting

光照用于照亮场景中的对象。Lights are used to illuminate objects in a scene. 每个对象顶点的颜色基于当前纹理贴图、顶点颜色和光源。The color of each object vertex is based on the current texture map, vertex colors, and light sources.

请注意  本部分仅适用于固定函数管道。Note   This section is only for the fixed-function pipeline. 可编程着色器显式执行所有照明。Programmable shaders perform all lighting explicitly.

 

本部分中的内容In this section

主题Topic 描述Description

照明概述Lighting overview

使用 Direct3D 照明时,Direct3D 负责为你处理照明细节。When you use Direct3D lighting, you allow Direct3D to handle the details of illumination for you. 如果需要,高级用户可以自行执行照明。Advanced users can perform lighting on their own, if desired.

光类型Light types

光类型属性定义所用光源的类型。The light type property defines which type of light source you're using. Direct3D 中有三种类型的光 - 点光、聚光和定向光。There are three types of lights in Direct3D - point lights, spotlights, and directional lights.

光源属性Light properties

光属性描述光源的类型(点光、定向光、聚光)、衰减、颜色、方向、位置和范围。Light properties describe a light source's type (point, directional, spotlight), attenuation, color, direction, position, and range.

照明的数学Mathematics of lighting

Direct3D 光模型涵盖环境、漫射、高光和放射照明。The Direct3D Light Model covers ambient, diffuse, specular, and emissive lighting. 它足够灵活,可解决广泛的照明情况。This is enough flexibility to solve a wide range of lighting situations. 场景中光的总量称作全局照明The total amount of light in a scene is called the global illumination.

 

相关主题Related topics

Direct3D 图形学习指南Direct3D Graphics Learning Guide