Newxog volume: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(30 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{langsp}}
{{this is a|brush entity|name=newxog_volume|game=Black Mesa}} This is xog (Xen Fog) volume, brush entity that creates a fog transition, making spaces appear deeper than they are.
{{CDA|CNewXogVolume|CBaseTrigger|CBaseToggle|CBaseEntity|}}
[[File:Newxog_volume_picture1.png|thumb|right|510px|Xog volume example.]]
[[File:Tools_xogvolume.png|thumb|right|170px|The texture that use level designers to mark this entity.]]
{{note|This entity have [[trigger_once]] functions but they are not in [[FGD]] and never work.}}
{{tip|Use <code>tools/tools_xogvolume</code> texture for your xog volumes to quickly distinguish them from triggers while level creation.}}
{{tip|In addition to using this entity as a fog in certain areas, it is also great for use for [[func_water_analog]], since [[func_water_analog]] haven't itown fog in it's volume.}}
{{important|This entity doesn't affects optimization, this entity for visual effects only.}}
{{important|This brush entity uses [[Bounding_box|bbox]] brush volume to render and not brush volume itself.
{{expand|title=An example.|
<br>
<gallery mode=packed heights=210px>
File:XogVolume1.png |Xog brush volume in [[Hammer]].
File:XogVolume2.png |Xog in the game.
</gallery>
}}
}}
{{todo|Rework page and replace .gif files with video links.}}
 
 
==Keyvalues==
==Keyvalues==
{{KV|Enabled|intn=Enabled|Choices|Enable/Disable this Entity.
{{KV|Enabled|intn=Enabled|Choices|
Determines is this entity enabled or disabled on spawn.
Determines is this entity enabled or disabled on spawn.
*0: Enabled
*0: Enabled
Line 7: Line 26:
}}
}}
{{KV|Shape Type|intn=xogtype|Choices|
{{KV|Shape Type|intn=xogtype|Choices|
Determines shape type that use xog volume, [[Bounding_box|BBOX]] or [https://en.wikipedia.org/wiki/Ellipsoid Ellipsoid].
Shape type to use. You can use [[Bounding_box|BBOX]] or [https://en.wikipedia.org/wiki/Ellipsoid Ellipsoid].
*0:0: LocalVolume BBOX
*0:0: LocalVolume BBOX
*1:1: LocalVolume Ellipsoid
*1:1: LocalVolume Ellipsoid
Line 13: Line 32:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=400px>
<gallery mode=nolines heights=400px widths=320px>
File:xogtype1.jpg| thumb | left | 510px | BBOX
File:xogtype1.jpg|BBOX
File:xogtype2.jpg| thumb | left | 510px | Ellipsoid
File:xogtype2.jpg|Ellipsoid
</gallery>
</gallery>
}}
}}
{{KV|colorMode|intn=colormode|Choices|
{{KV|colorMode|intn=colormode|Choices|
Determines color mode.
This is [[FGD]] leftover from {{ent|newxog_global}}. This feature doesn't work for this entity.}}
*0:0:StaticColor
*1:1:1DGradTexture
*2:2: CubeGradTexture
}}
{{KV|Texture name Grad Texture|intn=texname|string|
{{KV|Texture name Grad Texture|intn=texname|string|
Xog gradient texture name. The default is <code>xen/effects/xen_sky_6_blurred_32</code>.
This is [[FGD]] leftover from {{ent|newxog_global}}. This feature doesn't work for this entity.
}}
}}
{{KV|colorTop|intn=colortop|color255|
{{KV|colorTop|intn=colortop|color255|
Xog top color. This is the main color of xog that uses if <code>Enable Height Blend</code> KV is disabled.
Xog top color. This is the main color of xog that uses if <code>Enable Height Blend</code> property is disabled.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:colortop1.jpg| thumb | left | 510px | colorTop - 255 0 0. colorBottom - 0 255 0.
File:colortop1.jpg|colorTop - 255 0 0. colorBottom - 0 255 0.
File:colortop2.jpg| thumb | left | 510px | colorTop - 0 0 255. colorBottom - 0 255 0.
File:colortop2.jpg|colorTop - 0 0 255. colorBottom - 0 255 0.
File:colortop3.jpg| thumb | left | 510px | colorTop - 255 0 255. colorBottom - 0 255 0.
File:colortop3.jpg|colorTop - 255 0 255. colorBottom - 0 255 0.
</gallery>
</gallery>
}}
}}
Line 44: Line 59:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines widths=320px heights=290px>
File:colortop1.jpg| thumb | left | 510px | colorTop - 255 0 0. colorBottom - 0 255 0.
File:colortop1.jpg|colorTop - 255 0 0. colorBottom - 0 255 0.
File:CColorbottom2.jpg| thumb | left | 510px | colorTop - 255 0 0. colorBottom - 255 255 255.
File:CColorbottom2.jpg|colorTop - 255 0 0. colorBottom - 255 255 255.
File:CColorbottom3.jpg| thumb | left | 510px | colorTop - 255 0 0. colorBottom - 0 255 255.
File:CColorbottom3.jpg|colorTop - 255 0 0. colorBottom - 0 255 255.
</gallery>
</gallery>
}}
}}
Line 55: Line 70:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:cdiststart1.jpg| thumb | left | 510px | distStart - 10. distEnd - 100.
File:cdiststart1.jpg|distStart - 10. distEnd - 100.
File:diststart2.jpg| thumb | left | 510px | distStart - 70. distEnd - 100.
File:diststart2.jpg|distStart - 70. distEnd - 100.
File:diststart3.jpg| thumb | left | 510px | distStart - 200. distEnd - 100.
File:diststart3.jpg|distStart - 200. distEnd - 100.
</gallery>
}}
{{bug|hidetested=1|Numbers lower than 1 cause xog graphics issues.
{{expand|title=Bug examples|
<br>
<gallery mode=nolines heights=290px widths=320px>
File:XogdistBug1.jpg|Black Mesa - <code>bm_c1a2c</code>. As you can see, the fog is drawn through the geometry and models (with exception of [[viewmodel]]).
File:XogdistBug2.jpg|Black Mesa - <code>bm_c1a2c</code>. As you can see, the fog is drawn through the geometry and models (with exception of [[viewmodel]]).
</gallery>
</gallery>
}}
}}
}}
{{KV|distEnd|intn=distend|float|distEnd
{{KV|distEnd|intn=distend|float|distEnd
Line 66: Line 90:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:distend1.jpg| thumb | left | 510px | distStart - 10. distEnd - 100.
File:distend1.jpg|distStart - 10. distEnd - 100.
File:distend2.jpg| thumb | left | 510px | distStart - 10. distEnd - 700.
File:distend2.jpg|distStart - 10. distEnd - 700.
File:distend3.jpg| thumb | left | 510px | distStart - 10. distEnd - 2000.
File:distend3.jpg|distStart - 10. distEnd - 2000.
</gallery>
</gallery>
}}
{{bug|hidetested=1|Numbers lower than 1 cause xog graphics issues.
{{expand|title=Bug examples|
<br>
<gallery mode=nolines heights=290px widths=320px>
File:XogdistBug1.jpg|Black Mesa - <code>bm_c1a2c</code>. As you can see, the fog is drawn through the geometry and models (with exception of [[viewmodel]]).
File:XogdistBug2.jpg|Black Mesa - <code>bm_c1a2c</code>. As you can see, the fog is drawn through the geometry and models (with exception of [[viewmodel]]).
</gallery>
}}
}}
}}
{{note|The difference in values of distStart and distEnd should be not too big, otherwise the fog will be unsmooth.}}
{{note|The difference in values of distStart and distEnd should be not too big, otherwise the fog will be unsmooth.}}
{{KV|distDensity|intn=distdensity|float|distDensity
{{KV|distDensity|intn=distdensity|float|
Density of xog entity, only values from 0 to 1 works.
Density of xog entity, only values from 0 to 1 works.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:distDensity1.jpg| thumb | left | 510px | 0
File:distDensity1.jpg|0
File:distDensity2.jpg| thumb | left | 510px | 1
File:distDensity2.jpg|1
</gallery>
</gallery>
}}
}}
{{KV|opacityOffsetTop|intn=opacityoffsettop|float|opacityOffsetTop
{{KV|opacityOffsetTop|intn=opacityoffsettop|float|
Offsets top color of xog.
Offsets top color of xog.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:opacityOffsetTop1.jpg| thumb | left | 510px | opacityOffsetTop - 0.0.
File:opacityOffsetTop1.jpg|opacityOffsetTop - 0.0.
File:opacityOffsetTop2.jpg| thumb | left | 510px | opacityOffsetTop - 0.5.
File:opacityOffsetTop2.jpg|opacityOffsetTop - 0.5.
File:opacityOffsetTop3.jpg| thumb | left | 510px | opacityOffsetTop - 2.0.
File:opacityOffsetTop3.jpg|opacityOffsetTop - 2.0.
</gallery>
</gallery>
}}
}}
{{KV|opacityOffsetBottom|intn=opacityoffsetbottom|float|opacityOffsetBottom
{{KV|opacityOffsetBottom|intn=opacityoffsetbottom|float|
Offsets bottom color of xog.
Offsets bottom color of xog.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:opacityOffsetBottom1.jpg| thumb | left | 510px | opacityOffsetBottom - 0.0.
File:opacityOffsetBottom1.jpg|opacityOffsetBottom - 0.0.
File:opacityOffsetBottom2.jpg| thumb | left | 510px | opacityOffsetBottom - 0.2.
File:opacityOffsetBottom2.jpg|opacityOffsetBottom - 0.2.
File:opacityOffsetBottom3.jpg| thumb | left | 510px | opacityOffsetBottom - 1.0.
File:opacityOffsetBottom3.jpg|opacityOffsetBottom - 1.0.
</gallery>
</gallery>
}}
}}
{{KV|htZStart|intn=htzstart|float|htZStart
{{KV|htZStart|intn=htzstart|float|
Height that xog starts rendering at.
Height that xog starts rendering at.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:htZStart1.jpg| thumb | left | 510px | htZStart - 80. htZEnd - 0.
File:htZStart1.jpg|htZStart - 80. htZEnd - 0.
File:htZStart2.jpg| thumb | left | 510px | htZStart - 90. htZEnd - 0.
File:htZStart2.jpg|htZStart - 90. htZEnd - 0.
File:htZStart3.jpg| thumb | left | 510px | htZStart - 90. htZEnd - 10.
File:htZStart3.jpg|htZStart - 90. htZEnd - 10.
</gallery>
</gallery>
}}
}}
{{KV|htZEnd|intn=htzend|float|htZEnd
{{KV|htZEnd|intn=htzend|float|
Height that xog stops rendering at.
Height that xog stops rendering at.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:htZEnd1.jpg| thumb | left | 510px | htZStart - 0. htZEnd - 80.
File:htZEnd1.jpg|htZStart - 0. htZEnd - 80.
File:htZEnd2.jpg| thumb | left | 510px | htZStart - 0. htZEnd - 120.
File:htZEnd2.jpg|htZStart - 0. htZEnd - 120.
File:htZEnd3.jpg| thumb | left | 510px | htZStart - 0. htZEnd - 400.
File:htZEnd3.jpg|htZStart - 0. htZEnd - 400.
</gallery>
</gallery>
}}
}}
{{KV|htZColStart|intn=htzcolstart|float|htZColStart
{{KV|htZColStart|intn=htzcolstart|float|
Height that xog color starts rendering at. Results depend on <code>htZColEnd</code> value.
Height that xog color starts rendering at. Results depend on <code>htZColEnd</code> value.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:htZColStart1.jpg| thumb | left | 510px | htZColStart - 0.
File:htZColStart1.jpg|htZColStart - 0.
File:htZColStart2.jpg| thumb | left | 510px | htZColStart - 50.
File:htZColStart2.jpg|htZColStart - 50.
File:htZColStart3.jpg| thumb | left | 510px | htZColStart - 150.
File:htZColStart3.jpg|htZColStart - 150.
</gallery>
</gallery>
}}
}}
{{KV|htZColEnd|intn=htzcolend|float|htZColEnd
{{KV|htZColEnd|intn=htzcolend|float|
Height that xog color stops rendering at. Results depend on <code>htZColStart</code> value.
Height that xog color stops rendering at. Results depend on <code>htZColStart</code> value.
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:htZColStart1.jpg| thumb | left | 510px | htZColEnd - 400.
File:htZColStart1.jpg|htZColEnd - 400.
File:htZColEnd2.jpg| thumb | left | 510px | htZColEnd - 100.
File:htZColEnd2.jpg|htZColEnd - 100.
File:htZColEnd3.jpg| thumb | left | 510px | htZColEnd - 190.
File:htZColEnd3.jpg|htZColEnd - 190.
</gallery>
</gallery>
}}
}}
{{KV|noise1ScrollSpeed|intn=noise1scrollspeed|vector|
{{KV|noise1ScrollSpeed|intn=noise1scrollspeed|vector|
Layer one, speed at which noise moves trough xog volume (X Y Z).
Layer one, speed at which noise moves through xog volume (X Y Z).
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=packed heights=290px widths=320px>
File:noise1ScrollSpeed1.gif| thumb | left | 510px | noise1ScrollSpeed - 1 0 0.
File:noise1ScrollSpeed1_n.gif| frame |noise1ScrollSpeed - 1 0 0.
File:noise1ScrollSpeed2.gif| thumb | left | 510px | noise1ScrollSpeed - 0 1 0.
File:noise1ScrollSpeed2_n.gif| frame |noise1ScrollSpeed - 0 1 0.
File:noise1ScrollSpeed3.gif| thumb | left | 510px | noise1ScrollSpeed - 0 0 1.
File:noise1ScrollSpeed3_n.gif| frame |noise1ScrollSpeed - 0 0 1.
</gallery>
</gallery>
}}
}}
{{KV|noise1Tiling|intn=noise1tiling|vector|
{{KV|noise1Tiling|intn=noise1tiling|vector|
Layer one, tiling speed at which noise moves trough xog volume (X Y Z).
Layer one, tiling speed at which noise moves through xog volume (X Y Z).
}}
}}
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:noise1Tiling1.jpg| thumb | left | 510px | noise1Tiling - 10 1 1.
File:noise1Tiling1.jpg|noise1Tiling - 10 1 1.
File:noise1Tiling2.jpg| thumb | left | 510px | noise1Tiling - 1 10 1.
File:noise1Tiling2.jpg|noise1Tiling - 1 10 1.
File:noise1Tiling3.jpg| thumb | left | 510px | noise1Tiling - 1 1 10.
File:noise1Tiling3.jpg|noise1Tiling - 1 1 10.
</gallery>
</gallery>
}}
}}
{{KV|noise2ScrollSpeed|intn=noise2scrollspeed|vector|
{{KV|noise2ScrollSpeed|intn=noise2scrollspeed|vector|
Layer two, speed at which noise moves trough xog volume (X Y Z).
Layer two, speed at which noise moves through xog volume (X Y Z).
}}
}}
{{expand|title=Examples2|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=packed heights=290px widths=520px>
File:noise2ScrollSpeed1.gif| thumb | left | 510px | noise2ScrollSpeed - 1 0 0.
File:noise2ScrollSpeed1_n.gif| frame |noise2ScrollSpeed - 1 0 0.
File:noise2ScrollSpeed2.gif| thumb | left | 510px | noise2ScrollSpeed - 0 1 0.
File:noise2ScrollSpeed2_n.gif| frame |noise2ScrollSpeed - 0 1 0.
File:noise2ScrollSpeed3.gif| thumb | left | 510px | noise2ScrollSpeed - 0 0 1.
File:noise2ScrollSpeed3_n.gif| frame |noise2ScrollSpeed - 0 0 1.
</gallery>
</gallery>
}}
}}
Line 187: Line 220:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:noise2Tiling1.jpg| thumb | left | 510px | noise2Tiling - 10 1 1.
File:noise2Tiling1.jpg|noise2Tiling - 10 1 1.
File:noise2Tiling2.jpg| thumb | left | 510px | noise2Tiling - 1 10 1.
File:noise2Tiling2.jpg|noise2Tiling - 1 10 1.
File:noise2Tiling3.jpg| thumb | left | 510px | noise2Tiling - 1 1 10.
File:noise2Tiling3.jpg|noise2Tiling - 1 1 10.
</gallery>
</gallery>
}}
}}
Line 198: Line 231:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:noisecontrast1.jpg| thumb | left | 510px | 0.1
File:noisecontrast1.jpg|0.1
File:noisecontrast2.jpg| thumb | left | 510px | 1.0
File:noisecontrast2.jpg|1.0
File:noisecontrast3.jpg| thumb | left | 510px | 3.0
File:noisecontrast3.jpg|3.0
</gallery>
</gallery>
}}
}}
Line 209: Line 242:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=290px>
<gallery mode=nolines heights=290px widths=320px>
File:noisemultiplier1.jpg| thumb | left | 510px | 0.1
File:noisemultiplier1.jpg|0.1
File:noisemultiplier2.jpg| thumb | left | 510px | 1
File:noisemultiplier2.jpg|1
File:noisemultiplier3.jpg| thumb | left | 510px | 10
File:noisemultiplier3.jpg|10
</gallery>
</gallery>
}}
}}
{{KV|Enable Height Blend|intn=enablevol_height|choices|Enable/Disable this heightbased xog.
{{KV|Enable Height Blend|intn=enablevol_height|choices|
Determines top color and blending is disabled or enabled.
Determines bottom color and blending is disabled or enabled.
*0: Disabled
*0: Disabled
*1: Enabled
*1: Enabled
Line 222: Line 255:
{{expand|title=Examples|
{{expand|title=Examples|
<br>
<br>
<gallery mode=packed heights=400px>
<gallery mode=nolines heights=400px widths=320px>
File:enablevol_height1.jpg| thumb | left | 510px | Enable Height Blend - No. colorTop - 255 0 0 255, colorBottom - 0 255 0 255.
File:enablevol_height1.jpg|Enable Height Blend - No. colorTop - 255 0 0 255, colorBottom - 0 255 0 255.
File:enablevol_height2.jpg| thumb | left | 510px | Enable Height Blend - Yes. colorTop - 255 0 0 255, colorBottom - 0 255 0 255.
File:enablevol_height2.jpg|Enable Height Blend - Yes. colorTop - 255 0 0 255, colorBottom - 0 255 0 255.
</gallery>
</gallery>
}}
}}
{{KV BaseEntity|base=1}}


==Flags==
==Inputs==
{{Fl BaseTrigger}}
{{I|TurnOn|param=void|Turn xog on.}}
{{I|TurnOff|param=void|Turn xog off.}}
{{I|Toggle|param=void|Toggle the xog between on and off stages.}}
 
==Bugs/Limitations==
====Xog incorrect work with [[$translucent]]====
Xog all time fully rendering through everything with [[material]] [[shader]] parameter [[$translucent]]. This happen because of game can't tell the depth of scene because of the transparency.
<br>
<gallery mode=nolines heights=410px widths=320px>
File:XBugHah.jpg| No [[$translucent]]. Behind the wall placed xog volume and some models with small room.
File:XBugDamn.jpg| With [[$translucent]]. Now player see everything, but only what in xog.
</gallery>
Similar issue happen if use [[$alphatestreference]] incorrectly.
<br>
This problem also applies to brushes which not have [[$translucent]], but which parented to brushes that have this parameter. Similar will happen if brush with [[$translucent]] is part of your brush entity. Same will happen if you use [[overlays]]/[[decals]] on brushes with [[$translucent]].
<br>
<gallery mode=nolines heights=410px widths=320px>
File:XMS1.jpg| Metal speaker is overlay that use [[$alphatest]], but xog fully visible anyway, because overlay pasted on the transparency window.
</gallery>
This issues does not happen if replace [[LightmappedGeneric]] to [[ShatteredGlass]] or [[UnlitGeneric]], so, you can use one of them for glass or transparency surfaces when it's needed.
<br>
<gallery mode=nolines heights=410px widths=320px>
File:XHahF1.jpg| [[LightmappedGeneric]].
File:XHahF2.jpg| [[ShatteredGlass]].
</gallery>
In some cases use [[$alphatest]] if it'll give similar to [[$translucent]] resualts.
----
====Xog incorrect work with [[$alphatestreference]] and [[$allowalphatocoverage]]====
[[$alphatestreference]] is a [[material]] [[shader]] parameter that specifies the threshold alpha channel value at which the surface should be transparent instead of opaque, default "0.5". [[$allowalphatocoverage]] creates translucent steps based on alpha values. Both have one and same problems with gbuffer.
For examples used this texture with this alpha channel.
<br>
<gallery mode=nolines heights=500px widths=520px>
File:C_ATSC_D.jpg| Diffuse texture.
File:C_ATSC_A.jpg| Alpha channel.
</gallery>
Here xog placed behind wall with the texture. We can see the circle part of that have alpha channel part which is invisible due to $alphatest, with enabled xog we see that the invisible part doesn't show through itself xog.
<br>
<gallery mode=nolines heights=500px widths=520px>
File:x_ODSL_1_С.jpg| Xog volume disabled.
File:x_ODSL_2_С.jpg| Xog volume enabled.
</gallery>
If use very low numbers you will see resualts like in the pictures.
<br>
<gallery mode=nolines heights=500px widths=520px>
File:xCCCC_11.jpg|Xog volume disabled.
File:x_CCCC_12.jpg|Xog volume enabled.
</gallery>
<br>
You can't escape this problem, only minimize effect with <code>$alphatestreference 0.1</code> or if paint alpha correct channel.
----
 
====Motion blur blurring viewmodel xog layer====
For some reason <code>Motion blur</code> blurring viewmodel xog layer, you can notice this when you just rotate camera. This issue happen even if xog behind other objects.
<br>
<gallery mode=packed heights=320px>
File: xVLLBASUalt.gif| frame |An example.
</gallery>
----


==Inputs==
====Xog incorrect work with <code>-tools</code>====
{{IO|TurnOn|param=void|Turn xog on.}}
If you don't use <code>Full Screen</code> - xog will incorrectly applying to screen.
{{IO|TurnOff|param=void|Turn xog off.}}
<br>
{{I BaseTrigger}}
<gallery mode=packed heights=250px widths=320px>
{{I BaseEntity}}
File: XIWWT.gif| frame |An example.
</gallery>
----
====Xog volume doesn't work with [[3D Skybox]]====
Don't use xog volumes in your 3D skyboxes, none of them will work at all.
<br>
<gallery mode=nolines heights=350px widths=320px>
File:XogIn3DSky.jpg|An example. We see that xog volume works fine, but 3D Skybox don't draw it.
</gallery>
----
====Xog doesn't refract by refract shader and fully draw through====
Unlike deferred lighting, xog doesn't refract by refract shader, also fully draw through.
<br>
<gallery mode=packed heights=350px widths=320px>
File:AnXodexample.gif| frame |An example.
</gallery>
If model with refraction behind wall with refraction - this cause issues like this.
<br>
<gallery mode=nolines heights=250px widths=320px>
File:XogRefractBugs_1.jpg|The magnifying lamps behind the wall with refraction. This wall doesn't show magnifying lamps to escape issues, but xog break this.
</gallery>
Similar issue with cloak material shader parameter.
<br>
<gallery mode=nolines heights=350px widths=320px>
File:XogAndCloak.jpg|An example with [[npc_human_assassin]].
</gallery>
----


==Outputs==
== See also ==
{{O BaseTrigger}}
* [[Xog Editor]] - the console-based xog editor.
{{O BaseEntity}}
* {{ent|newxog_global}} - global xog, similar to {{ent|env_fog_controller}}.
* {{ent|newxog_settings}} - entity that can change xog settings.
* {{ent|env_fog_controller}}
* {{ent|fog_volume}}
* [[Fog tutorial]]
* [[Fog Basics]]
* [[Dust, Fog, & Smoke]]
* [[color_correction|Color Correction]]
* {{ent|color_correction}} (entity)
* [https://chetanjags.wordpress.com/2023/07/11/blackmesa-xenengine-part2-how-a-frame-is-rendered/ BlackMesa XenEngine: Part2 – How a Frame is Rendered] (page from Black Mesa developer about how a frame rendered and xog.)
* [https://chetanjags.wordpress.com/2022/06/01/blackmesa-xenengine-part1-a-heavily-modified-source-engine/ BlackMesa XenEngine: Part1 – Heavily Modified Source Engine] (page from Black Mesa developer about Black Mesa engine, better known as [[Xengine]])

Latest revision as of 06:34, 27 May 2025

newxog_volume is a brush entity available in Black Mesa Black Mesa. This is xog (Xen Fog) volume, brush entity that creates a fog transition, making spaces appear deeper than they are.

C++ Class hierarchy
CNewXogVolume
CBaseTrigger
CBaseToggle
CBaseEntity
Xog volume example.
The texture that use level designers to mark this entity.
Note.pngNote:This entity have trigger_once functions but they are not in FGD and never work.
Tip.pngTip:Use tools/tools_xogvolume texture for your xog volumes to quickly distinguish them from triggers while level creation.
Tip.pngTip:In addition to using this entity as a fog in certain areas, it is also great for use for func_water_analog, since func_water_analog haven't itown fog in it's volume.
Icon-Important.pngImportant:This entity doesn't affects optimization, this entity for visual effects only.
Icon-Important.pngImportant:This brush entity uses bbox brush volume to render and not brush volume itself.
An example.


Todo: Rework page and replace .gif files with video links.


Keyvalues

Enabled (Enabled) <choices>
Determines is this entity enabled or disabled on spawn.
  • 0: Enabled
  • 1: Disabled
Shape Type (xogtype) <choices>
Shape type to use. You can use BBOX or Ellipsoid.
  • 0:0: LocalVolume BBOX
  • 1:1: LocalVolume Ellipsoid
Examples


colorMode (colormode) <choices>
This is FGD leftover from newxog_global. This feature doesn't work for this entity.
Texture name Grad Texture (texname) <string>
This is FGD leftover from newxog_global. This feature doesn't work for this entity.
colorTop (colortop) <color255>
Xog top color. This is the main color of xog that uses if Enable Height Blend property is disabled.
Examples


Note.pngNote:Top and bottom colors blending in xog center, for example with red and green colors the center of xog will be yellow.
colorBottom (colorbottom) <color255>
Xog bottom color. Requires enabled Enable Height Blend to be working.
Examples


distStart (diststart) <float>
distStart

Xog start draw distance.

Examples


Icon-Bug.pngBug:Numbers lower than 1 cause xog graphics issues.
Bug examples


distEnd (distend) <float>
distEnd

Xog end draw distance.

Examples


Icon-Bug.pngBug:Numbers lower than 1 cause xog graphics issues.
Bug examples


Note.pngNote:The difference in values of distStart and distEnd should be not too big, otherwise the fog will be unsmooth.
distDensity (distdensity) <float>
Density of xog entity, only values from 0 to 1 works.
Examples


opacityOffsetTop (opacityoffsettop) <float>
Offsets top color of xog.
Examples


opacityOffsetBottom (opacityoffsetbottom) <float>
Offsets bottom color of xog.
Examples


htZStart (htzstart) <float>
Height that xog starts rendering at.
Examples


htZEnd (htzend) <float>
Height that xog stops rendering at.
Examples


htZColStart (htzcolstart) <float>
Height that xog color starts rendering at. Results depend on htZColEnd value.
Examples


htZColEnd (htzcolend) <float>
Height that xog color stops rendering at. Results depend on htZColStart value.
Examples


noise1ScrollSpeed (noise1scrollspeed) <vector>
Layer one, speed at which noise moves through xog volume (X Y Z).
Examples


noise1Tiling (noise1tiling) <vector>
Layer one, tiling speed at which noise moves through xog volume (X Y Z).
Examples


noise2ScrollSpeed (noise2scrollspeed) <vector>
Layer two, speed at which noise moves through xog volume (X Y Z).
Examples


noise2Tiling (noise2tiling) <vector>
Layer two, tiling speed at which noise moves trough xog volume (X Y Z).
Examples


noiseContrast (noisecontrast) <float>
Contrast of xog.
Examples


noiseMultiplier (noisemultiplier) <float>
Multiplier of xog.
Examples


Enable Height Blend (enablevol_height) <choices>
Determines bottom color and blending is disabled or enabled.
  • 0: Disabled
  • 1: Enabled
Examples


Inputs

TurnOn <void>
Turn xog on.
TurnOff <void>
Turn xog off.
Toggle <void>
Toggle the xog between on and off stages.

Bugs/Limitations

Xog incorrect work with $translucent

Xog all time fully rendering through everything with material shader parameter $translucent. This happen because of game can't tell the depth of scene because of the transparency.

Similar issue happen if use $alphatestreference incorrectly.
This problem also applies to brushes which not have $translucent, but which parented to brushes that have this parameter. Similar will happen if brush with $translucent is part of your brush entity. Same will happen if you use overlays/decals on brushes with $translucent.

This issues does not happen if replace LightmappedGeneric to ShatteredGlass or UnlitGeneric, so, you can use one of them for glass or transparency surfaces when it's needed.

In some cases use $alphatest if it'll give similar to $translucent resualts.


Xog incorrect work with $alphatestreference and $allowalphatocoverage

$alphatestreference is a material shader parameter that specifies the threshold alpha channel value at which the surface should be transparent instead of opaque, default "0.5". $allowalphatocoverage creates translucent steps based on alpha values. Both have one and same problems with gbuffer. For examples used this texture with this alpha channel.

Here xog placed behind wall with the texture. We can see the circle part of that have alpha channel part which is invisible due to $alphatest, with enabled xog we see that the invisible part doesn't show through itself xog.

If use very low numbers you will see resualts like in the pictures.


You can't escape this problem, only minimize effect with $alphatestreference 0.1 or if paint alpha correct channel.


Motion blur blurring viewmodel xog layer

For some reason Motion blur blurring viewmodel xog layer, you can notice this when you just rotate camera. This issue happen even if xog behind other objects.


Xog incorrect work with -tools

If you don't use Full Screen - xog will incorrectly applying to screen.


Xog volume doesn't work with 3D Skybox

Don't use xog volumes in your 3D skyboxes, none of them will work at all.


Xog doesn't refract by refract shader and fully draw through

Unlike deferred lighting, xog doesn't refract by refract shader, also fully draw through.

If model with refraction behind wall with refraction - this cause issues like this.

Similar issue with cloak material shader parameter.


See also