# render.DepthRange

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

```lua
render.DepthRange( number depthmin, number depthmax )
```

## Açıklama

Yaklaşan görüntülemenin derinlik aralığı ayarlandı.

> **NOT:** Görünüm modelleri derinlik aralığı ile çizilir. `0` ...ya da `0.1` Normal yerine. `0` ...ya da `1`Değeri yanlış ayarlamak görüntüleme sorunlarına neden olabilir.

## Argümanlar

1.. [numara](https://gmod.tr/wiki/number) **derinlikmin**: Yaklaşan görüntülemenin minimum derinliği. `0.0` = normal bir şekilde göster; `1.0` = hiçbir şey vermez.
2.. [numara](https://gmod.tr/wiki/number) **derinlikmax**: Yaklaşan renderin maksimum derinliği. `0.0` = her şeyi göster (duvarlar üzerinden); `1.0` = normal bir şekilde göster.

### Örnek

Müşteri bağlandıktan sonra tüm şeffaf olmayan nesnelere aşağıya doğru bir ekran silme etkisi uygulayın.

```lua
local depthmin = 1.0

hook.Add( "PreDrawOpaqueRenderables", "simple_effect", function( bDrawingDepth, bDrawingSkybox )
	render.DepthRange( depthmin, 1.0 )

	if ( depthmin > 0.0 ) then
		depthmin = depthmin - 0.001
	end
end )
```

### Örnek

Yukarıdakiyle aynı etki ancak modelin çizildiği yerde koyu bir gölge deri var.

```lua
local depthmin = 1.0
local spawn_copies = {}	-- Gölge kopyaları
local custom_white_color = Color( 255, 255, 255, 92 )

hook.Add( "PreDrawOpaqueRenderables", "advanced_effect", function( bDrawingDepth, bDrawingSkybox )
	render.DepthRange( depthmin, 1.0 )

	if ( !spawn_copies ) then return false end

	if ( depthmin > 0.0 ) then
		depthmin = depthmin - 0.001
	else
		local alpha = 0
		local valid_copies = 0

		- Gölge kopyalarını sil ve çıkar.
		for _, spawncopy in ipairs(spawn_copies) do
			if ( IsValid( spawncopy ) ) then
				alpha = spawncopy:GetColor().a

				if ( alpha > 0 ) then
					spawncopy:SetColor( Color( 255, 255, 255, alpha - 1 ) )
				else
					spawncopy:Remove()
				end

				valid_copies = valid_copies + 1
			end
		end

		-- Artık kullanmadığımız için masayı iptal edin.
		if ( valid_copies == 0 ) then
			spawn_copies = nil
		end
	end
end )

hook.Add( "OnEntityCreated", "advanced_effect", function( ent )
	if ( !spawn_copies ) then return end

	- Sonsuz döngü ve diğer hataları engeller.
	if ( ent:GetClass() ~= "class C_BaseFlex" and
		ent:GetRenderGroup() == RENDERGROUP_OPAQUE and
		ent:GetClass() ~= "gmod_hands" ) then

		local mdl = ent:GetModel()

		- Varlığın bir model olup olmadığını kontrol edin.
		if ( string.EndsWith( mdl, ".mdl" ) ) then
			local spawncopy = ClientsideModel( mdl )

			- $ignorez'in 1'e ayarlandığı bir madde burada en iyi şekilde çalışır.
			spawncopy:SetMaterial( "models/overlay_rendertarget" )
			spawncopy:AddEffects( EF_BONEMERGE )
			spawncopy:SetParent( ent )
			spawncopy:SetRenderMode( RENDERMODE_TRANSALPHA )
			spawncopy:SetColor( custom_white_color )

			table.insert( spawn_copies, spawncopy )
		end
	end
end )
```

**Çıkış:**

[Video](https://gmod.tr/api/uploads/wiki/38dd660db43328f4acbe.webm)

- [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.DepthRange
