# render.ComputeLighting

- **Ortam:** İstemci
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/render.ComputeLighting
- **Çeviri tarihi:** 2026-08-05

```lua
Vector render.ComputeLighting( Vector position, Vector normal )
```

## Açıklama

Belirli bir konumda ışık rengini hesaplar.

Bu hem çevre ışığını hem de dinamik aydınlatmayı içerir.

Görelim. [render. ComputeDynamicLighting](https://gmod.tr/wiki/render.ComputeDynamicLighting) Sadece dinamik ışık için.

Görelim. [render. GetAmbientLightColor](https://gmod.tr/wiki/render.GetAmbientLightColor) Harita çapında çevre rengi için.

## Argümanlar

1.. [Vektör](https://gmod.tr/wiki/Vector) **konumu**: Işığı yakacak pozisyon.
2.. [Vektör](https://gmod.tr/wiki/Vector) **Normal**: Işığın ulaşması için hayali bir yüzeyin yönü. Duvarlardan uzak tutmak, duvardaki ışığı alır.

## Geri dönüşler

1.. [Vektör](https://gmod.tr/wiki/Vector): Bu noktada ışığı temsil eden bir vektör.

### Örnek

Oyuncunun baktığı noktada ışık seviyesini görüntüler.

```lua
hook.Add( "HUDPaint", "test_navmesh", function()
	local ply = LocalPlayer()
	local tr = ply:GetEyeTrace()

	local startPos = tr.HitPos

	local color = render.ComputeLighting( startPos, tr.HitNormal )
	local colorDyn = render.ComputeDynamicLighting( startPos, tr.HitNormal )
	local colorAmbi = color - colorDyn

	local pos2D = startPos:ToScreen()
	pos2D.x = pos2D.x + 30

	draw.RoundedBox( 4, pos2D.x - 25, pos2D.y - 5, 250, 60, Color(0,0,0, 200 ) )

	draw.SimpleText( "Color: " .. tostring(color), "Default", pos2D.x, pos2D.y, color_white )
	draw.SimpleText( "Dynamic Color: " .. tostring(colorDyn), "Default", pos2D.x, pos2D.y + 20, color_white )
	draw.SimpleText( "Ambient Color: " .. tostring(colorAmbi), "Default", pos2D.x, pos2D.y + 40, color_white )

	draw.RoundedBox( 4, pos2D.x - 20, pos2D.y, 10, 10, Color( color.x * 255, color.y * 255, color.z * 255 ) )
	draw.RoundedBox( 4, pos2D.x - 20, pos2D.y + 20, 10, 10, Color( colorDyn.x * 255, colorDyn.y * 255, colorDyn.z * 255 ) )
	draw.RoundedBox( 4, pos2D.x - 20, pos2D.y + 40, 10, 10, Color( colorAmbi.x * 255, colorAmbi.y * 255, colorAmbi.z * 255 ) )
end )
```

**Çıkış:**

![July01-2855-gmod_win64.gif](https://gmod.tr/api/uploads/wiki/dd30f842cbab3f88cc58.gif)

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/render.ComputeLighting
