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

Water lod control: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (spam revert)
(its position in the world irrelevant so it's logical entity)
 
(24 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{wrongtitle|title=water_lod_control}}
{{LanguageBar}}__NOTOC__
{{base_point}}
{{CD|CWaterLODControl|file1=WaterLODControl.cpp}}


== Entity description ==
{{this is a|logical entity|name=water_lod_control|sprite=Waterlodcontrol.png}} It is used to control the [[LOD]] behavior of any water in the map. If your map has water, this entity is required. [[VBSP]] will add one in if it's missing.
[[Image:Waterlodcontrol.png|left]]An entity used to control the [[LOD]] behavior of any water in the map. If your map has water, this entity is required.
{{Map properties note}}
* {{map_properties}}
{{CD|C_WaterLODControl|base=C_BaseEntity|client=1|file1=1}}
{{clr}}
 
* See also [[Adding Water]]


== Keyvalues ==
== Keyvalues ==
* {{kv targetname}}
{{KV|Start Transition to Cheap Water|intn=cheapwaterstartdistance|float|This is the distance from the camera that water will start transitioning to cheap water, in hammer units.}}
* '''cheapwaterstartdistance'''
{{KV|End Transition to Cheap Water|intn=cheapwaterenddistance|float|This is the distance from the camera that water will finish transitioning to cheap water, in hammer units.}}
: <float> This is the distance (inches) from the camera that water will start transitioning to cheap water.
* '''cheapwaterenddistance'''
: <float> This is the distance (inches) from the camera that water will finish transitioning to cheap water.


== Inputs ==
== Inputs ==
* {{i targetname}}
{{I|SetCheapWaterStartDistance|Set the distance that water starts transitioning to cheap water.|param=float}}
* '''SetCheapWaterStartDistance <float>'''
{{I|SetCheapWaterEndDistance|Set the distance that water finishes transitioning to cheap water.|param=float}}
: Set the distance that water starts transitioning to cheap water.
 
* '''SetCheapWaterEndDistance <float>'''
 
: Set the distance that water finishes transitioning to cheap water.
{{expand|title={{elaborate}}|
== Caveats ==
{{bug|The water_lod_controller was disabled late in development. Any water with reflections enabled are always rendered expensively or with bForceExpensive always set to true.}}
 
To re-enable you will need to modify code in <code>CViewRender::DetermineWaterRenderInfo(...)</code> on line 2228, replace it with:
 
<source lang=cpp>if( !r_WaterDrawReflection.GetBool() )</source>
 
Also replace line 2256 with:
<source lang=cpp>if ( (fogVolumeInfo.m_flDistanceToWater >= m_flCheapWaterEndDistance) || bForceCheap )</source>
 
You may also change line 2212 with brute force code. All the materials in this example were returning bForceExpensive true regardless of settings:
<source lang=cpp>bForceExpensive = false;</source>
}}
 
== See also ==
* [[Adding Water]]


== Outputs ==
[[Category:Water]]
* {{o targetname}}

Latest revision as of 08:13, 29 April 2025

English (en)Translate (Translate)
C++ Class hierarchy
CWaterLODControl
CBaseEntity
C++ WaterLODControl.cpp
Waterlodcontrol.png

water_lod_control is a logical entity available in all Source Source games. It is used to control the LOD behavior of any water in the map. If your map has water, this entity is required. VBSP will add one in if it's missing.

Note.pngNote:The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors.
C++ Class hierarchy (client)
C_WaterLODControl
C_BaseEntity
C++ C_WaterLODControl.cpp

Keyvalues

Start Transition to Cheap Water (cheapwaterstartdistance) <float>
This is the distance from the camera that water will start transitioning to cheap water, in hammer units.
End Transition to Cheap Water (cheapwaterenddistance) <float>
This is the distance from the camera that water will finish transitioning to cheap water, in hammer units.

Inputs

SetCheapWaterStartDistance <floatRedirectInput/float>
Set the distance that water starts transitioning to cheap water.
SetCheapWaterEndDistance <floatRedirectInput/float>
Set the distance that water finishes transitioning to cheap water.


[Elaborate?]

Caveats

Icon-Bug.pngBug:The water_lod_controller was disabled late in development. Any water with reflections enabled are always rendered expensively or with bForceExpensive always set to true.  [todo tested in ?]

To re-enable you will need to modify code in CViewRender::DetermineWaterRenderInfo(...) on line 2228, replace it with:

if( !r_WaterDrawReflection.GetBool() )

Also replace line 2256 with:

if ( (fogVolumeInfo.m_flDistanceToWater >= m_flCheapWaterEndDistance) || bForceCheap )

You may also change line 2212 with brute force code. All the materials in this example were returning bForceExpensive true regardless of settings:

bForceExpensive = false;

See also