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

Func water analog: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 11: Line 11:
{{modernConfirm|Do the Water and Refract shaders work if using cubemap reflections and refractions, instead of the real-time versions? This would still be beneficial for the ability to have two normal maps scrolling in different directions.}} }}
{{modernConfirm|Do the Water and Refract shaders work if using cubemap reflections and refractions, instead of the real-time versions? This would still be beneficial for the ability to have two normal maps scrolling in different directions.}} }}


{{bug|Doesn't behave properly in {{l4d2}}! Physics don't behave properly if affected by this brush and graphical glitches can occur. Use sparingly and cautiously!}}
{{bug|Doesn't behave properly in {{l4d2}}! Physics don't behave properly if affected by this brush and graphical glitches can occur. Use sparingly and cautiously!|tested={{l4d2}}}}


{{bug|If this entity uses multiple brushes - [[VPhysics]] objects works incorrectly with this entity (the same for {{ent|func_water|engine=source}}) in {{bms|4}}. It looks like they are using this entity's [[Bounding box|BBox]] to calculate physics, instead of using brushes. This issue can be found in [[Interloper]] chapter. Separate water into several separate entities to avoid this bug.
{{bug|If this entity uses multiple brushes - [[VPhysics]] objects works incorrectly with this entity (the same for {{ent|func_water|engine=source}}) in {{bms|4}}. It looks like they are using this entity's [[Bounding box|BBox]] to calculate physics, instead of using brushes. This issue can be found in [[Interloper]] chapter. Separate water into several separate entities to avoid this bug.

Revision as of 07:58, 5 September 2024

English (en)Translate (Translate)
C++ Class hierarchy
CFuncMoveLinear
CBaseToggle
CBaseEntity
C++ func_movelinear.cpp

func_water_analog is a brush entity available in all Source Source games. It's a version of func_movelinear slightly specialized for use as water.

Icon-Important.pngImportant:Does not work with materials using real time reflections and/or refractions, as seen in Water and Refract.
Use a material which uses a regular brush shader, such as:
Confirm:Do the Water and Refract shaders work if using cubemap reflections and refractions, instead of the real-time versions? This would still be beneficial for the ability to have two normal maps scrolling in different directions.
Icon-Bug.pngBug:Doesn't behave properly in Left 4 Dead 2! Physics don't behave properly if affected by this brush and graphical glitches can occur. Use sparingly and cautiously!  (tested in: Left 4 Dead 2)
Icon-Bug.pngBug:If this entity uses multiple brushes - VPhysics objects works incorrectly with this entity (the same for func_water) in Black Mesa Black Mesa. It looks like they are using this entity's BBox to calculate physics, instead of using brushes. This issue can be found in Interloper chapter. Separate water into several separate entities to avoid this bug.
Examples.
Note how the hat "flying in air".
Note how the hat "flying in air".
  [todo tested in ?]
Icon-Bug.pngBug:This entity always has its contents set to CONTENTS_WATER (regardless of brush contents), with no way of setting its contents to CONTENTS_SLIME. In most games, this will only affect splash particles.
Cpp.pngCode Fix:Add a KV that is read by CMoveFuncLinear::CreateVPhysics to set fluid.contents (defaulting to CONTENTS_WATER if KV is absent)
  [todo tested in ?]
Note.pngNote:The SetPosition input and Start Position keyvalue do not perform any bounds checking, so values less than 0 and greater than 1 can be used. Negative values will move in the opposite direction to the movement direction, and values greater than 1 will move it in multiples of the set Move Distance. Moving past the opened/closed position does not trigger the OnFullyOpen and OnFullyClosed outputs.
Icon-Bug.pngBug:There are bugs that may arise when parenting this entity to any of these: func_movelinear, func_lookdoor, func_water_analog. A func_door (or for func_water_analog, func_water) can be used as a workaround. (see here for a code fix)[ Code Fix]
Confirm:Might be fixed in Portal 2? Parented movelinears are used extensively for this game's piston platforms.

Keyvalues

Water Material (WaterMaterial) <material> (only in Black Mesa)
The material to derive water information from. Determines $underwateroverlay that use func_water_analog.
Icon-Bug.pngBug:Don't work after reload. You still can repeat this effect with trigger and env_screenoverlay  [todo tested in ?]
Wave Height (WaveHeight) <string> (only in Black Mesa)


Note.pngNote:Other Keyvalues / Inputs / Outputs are same as func_movelinear.

See also