Water lod control: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 

 Note:The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors.
Note:The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors.
		
	
| mNo edit summary |  (its position in the world irrelevant so it's logical entity) | ||
| Line 2: | Line 2: | ||
| {{CD|CWaterLODControl|file1=WaterLODControl.cpp}} | {{CD|CWaterLODControl|file1=WaterLODControl.cpp}} | ||
| {{this is a| | {{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. | ||
| {{Map properties note}} | {{Map properties note}} | ||
| {{CD|C_WaterLODControl|base=C_BaseEntity|client=1|file1=1}} | {{CD|C_WaterLODControl|base=C_BaseEntity|client=1|file1=1}} | ||
Latest revision as of 08:13, 29 April 2025

 
|  Class hierarchy | 
|---|
| CWaterLODControl | 
|  WaterLODControl.cpp | 

water_lod_control  is a   logical entity  available in all  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.
 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:The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors.
Note:The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors.|  Class hierarchy (client) | 
|---|
| C_WaterLODControl | 
|  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 <float>
- Set the distance that water starts transitioning to cheap water.
- SetCheapWaterEndDistance <float>
- Set the distance that water finishes transitioning to cheap water.
| 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.  [todo tested in ?] To re-enable you will need to modify code in  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;
 | 
























