Newxog global

Xog (short for Xen Fog) is Screenspace Fog, very flexible new fog system that replaces Source's legacy fog. The new xog can be configured on the fly with instant results ingame, it can change over time with I/O, and it can vary in density and color based on height. Along with its tons of options, is that it became (sort of) the preferred way for level designers to do color corrections in the xen part of the game instead of the old color correction entity provided by Source Engine. Uses radial fog instead of deprecated planar/z fog. On top of 3 colors for blending, it support both 1D and cubemap gradient textures. The game also have console-based Xog Editor which can select and edit almost every property of any xog entity.
 Represented by class CNewXogGlobal.
==Keyvalues==
File:XogLimit.jpg|The engine error message.
==Inputs==
==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.
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.
File:XGloon.jpg| This is how it looks with beam from the gluon gun.
File:XFlare.jpg| This is how it looks with sun flare.
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.
File:XMS1.jpg| Metal speaker is overlay that use $alphatest, but xog fully visible anyway, because overlay pasted on the transparency window.
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.
File:XHahF1.jpg| LightmappedGeneric.
File:XHahF2.jpg| ShatteredGlass.
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.
File:C_ATSC_D.jpg| Diffuse texture.
File:C_ATSC_A.jpg| 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.
File:x_ODSL_1_С.jpg| Xog volume disabled.
File:x_ODSL_2_С.jpg| Xog volume enabled.
If use very low numbers you will see resualts like in the pictures.
File:xCCCC_11.jpg|Xog volume disabled.
File:x_CCCC_12.jpg|Xog volume enabled.
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.
File: BlurCrowbar.gif| frame |An example.
----
====Xog incorrect work with -tools====
If you don't use Full Screen - xog will incorrectly applying to screen.
File: CrazyThingX.jpg| frame |An example.
----
====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.
File:AnXodexample.gif| frame |An example with newxog_volume.
File:AnXodexampleG.gif| frame |An example with newxog_global.
File:RefractWithGlass.jpg| frame |This is how it looks behind objects which use transparency. The xog layer doesn't refracts at all.
File:ThisIsNotaJoke.jpg| frame |Here you can see that the tree and vortigaunt refracts incorrectly, or rather the xog layer.
This is why underwater plants in some xen levels so weird refracting if.
File:XPAX1.jpg| frame |Xog disabled. Everything looks right.
File:XPAX2.jpg| frame |Xog enabled. Now the pink plants looks buggy.
If model with refraction behind wall with refraction - this cause issues like this.
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.
Similar issue with cloak material shader parameter.
File:XogAndCloak.jpg|An example with npc_human_assassin.
====Sky xog works incorrectly with newxog_volume====
Both GlobalWithSky and SkyOnly always fully shows through xog volumes.
File:SkyXB1.jpg| frame |GlobalWithSky.
File:SkyXB2.jpg| frame |SkyOnly.
====Overwater layer====
You can note a strange layer when submerging in water.
File: NecroXogWater.gif| frame |Time is slowed down for clear example.
----
== See also ==
* Xog Editor - the console-based xog editor.
* - xog volume brush entity with ellipsoid and box shapes support.
* - entity that can change xog settings.
* 
* 
* Fog tutorial
* Fog Basics
* Dust, Fog, & Smoke
* Color Correction
* (entity)
* BlackMesa XenEngine: Part2 – How a Frame is Rendered (page from Black Mesa developer about how a frame rendered and xog.)
* BlackMesa XenEngine: Part1 – Heavily Modified Source Engine (page from Black Mesa developer about Black Mesa engine, better known as Xengine)