Water lod control: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Caveats: transformed to third person)
(-fixed icon, changed templates to use BaseEntity)
Line 1: Line 1:
{{base point|water_lod_control|sprite=waterlodcontrol}} 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.
{{base point|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.


{{map_properties}}
{{map_properties}}
Line 18: Line 18:


== Keyvalues ==
== Keyvalues ==
{{KV|Start Transition to Cheap Water|float|This is the distance from the camera that water will start transitioning to cheap water, in inches.}}
{{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 inches.}}
{{KV|End Transition to Cheap Water|float|This is the distance from the camera that water will finish transitioning to cheap water, in inches.}}
{{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 inches.}}
{{KV Targetname}}
{{KV BaseEntity}}


== Inputs ==
== Inputs ==
{{IO|SetCheapWaterStartDistance|Set the distance that water starts transitioning to cheap water.|param=float}}
{{IO|SetCheapWaterStartDistance|Set the distance that water starts transitioning to cheap water.|param=float}}
{{IO|SetCheapWaterEndDistance|Set the distance that water finishes transitioning to cheap water.|param=float}}
{{IO|SetCheapWaterEndDistance|Set the distance that water finishes transitioning to cheap water.|param=float}}
{{I Targetname}}
{{I BaseEntity}}


== Outputs ==
== Outputs ==
{{O Targetname}}
{{O BaseEntity}}


== See also ==
== See also ==
* [[Adding Water]]
* [[Adding Water]]
[[Category:Water]]
[[Category:Water]]

Revision as of 01:55, 9 May 2022

Template:Base point 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.

Template:Map properties

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;

Keyvalues

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


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.


Outputs

See also