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
mNo edit summary
m (Updated old entity format to {{this is a}}. This action was perfomed by a bot.)
Line 1: Line 1:
{{lang|title=water_lod_control}}__NOTOC__
<!-- When this page is updated to {{langsp}} or {{language subpage}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang}}__NOTOC__
{{CD|CWaterLODControl|file1=WaterLODControl.cpp}}
{{CD|CWaterLODControl|file1=WaterLODControl.cpp}}
{{entity|water_lod_control|type=e0|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.
{{this is a|e0|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.
{{map properties}}
{{map properties}}
{{clr}}
{{clr}}

Revision as of 13:15, 4 January 2024

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

water_lod_control is an e0 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.

Template:Map properties

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.

Caveats

Template:ModernBug

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