Karten für diffuses Licht (Direct3D 9)
Wenn sie von einer Lichtquelle beleuchtet werden, zeigen matte Oberflächen eine diffuse Lichtreflexion. Die Helligkeit des diffusen Lichts hängt vom Abstand zur Lichtquelle und dem Winkel zwischen der Normaloberfläche und dem Lichtquellenrichtungsvektor ab. Die durch Lichtberechnungen simulierten diffusen Lichteffekte erzeugen nur allgemeine Effekte.
Ihre Anwendung kann komplexere diffuse Beleuchtung mit Texturlichtkarten simulieren. Fügen Sie dazu die Diffuse Light Map zur Basistextur hinzu, wie im folgenden C++-Codebeispiel gezeigt.
// This example assumes that d3dDevice is a valid pointer to an
// IDirect3DDevice9 interface.
// lptexBaseTexture is a valid pointer to a texture.
// lptexDiffuseLightMap is a valid pointer to a texture that contains
// RGB diffuse light map data.
// Set the base texture.
d3dDevice->SetTexture(0,lptexBaseTexture );
// Set the base texture operation and args.
d3dDevice->SetTextureStageState(0,D3DTSS_COLOROP,
D3DTOP_MODULATE );
d3dDevice->SetTextureStageState(0,D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(0,D3DTSS_COLORARG2, D3DTA_DIFFUSE );
// Set the diffuse light map.
d3dDevice->SetTexture(1,lptexDiffuseLightMap );
// Set the blend stage.
d3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE );
d3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT );
Zugehörige Themen
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für