光源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