This article's documentation is for anything that uses the Source engine. Click here for more information.

Func lod: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(23 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{base brush|func_lod}}  
{{LanguageBar}}
{{CD|CFunc_LOD|file1=func_lod.cpp}}
{{this is a|brush entity|name=func_lod}}


==Entity description==
It is a [[bmodel]] that fades out over a specified distance. Useful for creating world details that don't need to be drawn far away, for performance reasons.
It is a [[Entity#Brush_entities|brush-built]] model that fades out over a specified distance. Useful for creating world detail that doesn't need to be drawn far away, for performance reasons.
{{brushmodel}}


{{Note|The fading is not always consistent; brushes may suddenly "pop" into view depending on where the player is looking. This happens because of a hardware issues with rendering translucent materials. Low-end cards will fade nearer than the distance specified, and smaller objects fade nearer than a larger object with the same fade distance.}}
{{Note|The fading is not always consistent; brushes may suddenly "pop" into view depending on where the player is looking. This happens because of a hardware issues with rendering translucent materials. Low-end cards will fade nearer than the distance specified, and smaller objects fade nearer than a larger object with the same fade distance.}}
 
{{bug|hidetested=1|Weapons from {{bms|4}} with muzzle dynamic lights causes strange visual bugs when player in End fade radius and out of Start fade radius. [https://youtu.be/GMBhGNI95as Example].}}
{{important|As this entity still counts as an [[edict]], overuse of this entity can be ''more'' [[expensive]] than simply using {{ent|func_detail}}. If the fade-out is necessary, consider [[Propper++|converting the geometry to a MDL]] and using {{ent|prop_static}} instead.}}
== Keyvalues ==
== Keyvalues ==
{{KV|Disappear Distance|integer|Distance at which these brushes should fade out.}}
{{Brush rendering note}}
{{KV|Solid|choices|Set whether or not these brushes should collide with other entities.}}
:* 0 : Solid
:* 1 : Nonsolid
{{KV Targetname}}
{{KV Targetname}}
 
{{KV|Disappear Distance|intn=DisappearDist|integer|Distance at which these brushes should start fading out. The finish fading out distance is value from this property +800, you can change it by setting other value for {{command|lod_TransitionDist}} console variable. Since {{l4d|4}}, fading out distance controlled by {{code|DisappearMaxDist}} property.}}
== Inputs ==
{{KV|Min Disappear Distance|intn=DisappearMinDist|integer|Distance at which these brushes should start fading out.|since={{l4d}}}}
{{I Targetname}}
{{KV|Max Disappear Distance|intn=DisappearMaxDist|integer|Distance at which these brushes should finish fading out.|since={{l4d}}}}
 
{{KV|Non-solid|intn=Solid|boolean|Set whether or not these brushes should collide with other entities.}}
== Outputs ==
:{{note|When using [[AddOutput]], this entity can be only changed from solid to nonsolid, not vice versa.}}
{{O Targetname}}
 
==Tutorials about Func_Lod (Russian)==
Lessons created by [https://vk.com/project_source Project-S]
 
*[https://www.youtube.com/watch?v=VhZNHzQoFNI Func_Lod + Func_Wall]

Latest revision as of 18:22, 6 May 2025

English (en)Translate (Translate)
C++ Class hierarchy
CFunc_LOD
CBaseEntity
C++ func_lod.cpp

func_lod is a brush entity available in all Source Source games.

It is a bmodel that fades out over a specified distance. Useful for creating world details that don't need to be drawn far away, for performance reasons.

Note.pngNote:The fading is not always consistent; brushes may suddenly "pop" into view depending on where the player is looking. This happens because of a hardware issues with rendering translucent materials. Low-end cards will fade nearer than the distance specified, and smaller objects fade nearer than a larger object with the same fade distance.
Icon-Bug.pngBug:Weapons from Black Mesa Black Mesa with muzzle dynamic lights causes strange visual bugs when player in End fade radius and out of Start fade radius. Example.
Icon-Important.pngImportant:As this entity still counts as an edict, overuse of this entity can be more expensive than simply using func_detail. If the fade-out is necessary, consider converting the geometry to a MDL and using prop_static instead.

Keyvalues

Note.pngNote:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Disappear Distance (DisappearDist) <integer>
Distance at which these brushes should start fading out. The finish fading out distance is value from this property +800, you can change it by setting other value for lod_TransitionDist console variable. Since Left 4 Dead Left 4 Dead, fading out distance controlled by DisappearMaxDist property.
Min Disappear Distance (DisappearMinDist) <integer> (in all games since Left 4 Dead)
Distance at which these brushes should start fading out.
Max Disappear Distance (DisappearMaxDist) <integer> (in all games since Left 4 Dead)
Distance at which these brushes should finish fading out.
Non-solid (Solid) <boolean>
Set whether or not these brushes should collide with other entities.
Note.pngNote:When using AddOutput, this entity can be only changed from solid to nonsolid, not vice versa.