newxog_global
newxog_global
is a point entity available in Black Mesa. 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
.
Contents
- 1 Keyvalues
- 2 Inputs
- 3 Outputs
- 4 Bugs/Limitations
- 4.1 Xog incorrect work with $translucent
- 4.2 Xog incorrect work with $alphatestreference and $allowalphatocoverage
- 4.3 Motion blur blurring viewmodel xog layer
- 4.4 Xog incorrect work with -tools
- 4.5 Xog doesn't refract by refract shader and fully draw through
- 4.6 Sky xog works incorrectly with newxog_volume
- 4.7 SkyOnly buggy
- 4.8 Overwater layer
- 5 See also
Keyvalues
Targetname:
- Name
(targetname)
<string> - The targetname that other entities refer to this entity by.
- Enabled
(Enabled)
<choices> - Enable/Disable this Entity.
Determines is this entity enabled or disabled on spawn.
- 0: Enabled
- 1: Disabled
- Xog Type
(xogtype)
<choices> - Determines xog type. Global - render xog in world space only. GlobalWithSky - render xog in world space and add third layer for skybox (without color blending, uses
skyColor
instead). SkyOnly - xog will be applied to skybox with color blending,skyBlendFactor
will not work, decreased intensity will show a "black void" instead of skybox.
- 0:0: Global
- 1:1: GlobalWithSky
- 2:2: SkyOnly
|
GlobalWithSky
or Global
with SkyOnly
(separately as well) in your level. Otherwise, game will crash on map launch with this engine error message.
- skyColor
(skycolor)
<color255> - Xog color in 2D skybox.
|
- skyBlendFactor
(skyblendfactor)
<float> - Xog intensity in skybox. This is a float value from 0.0 to 1.0.
|
- Color Mode
(colormode)
<choices> - Determines color mode. With StaticColor it will use color from
colorBottom
andcolorTop
, doesn't affects color in skybox. With 1DGradTexture, color will depends on texture fromGrad Texture
, doesn't affects color in skybox.
- 0:0: StaticColor
- 1:1: 1DGradTexture
- 2:2: CubeGradTexture
|
- Grad Texture
(texname)
<string> - Grad texture to use.
Grad texture uses .vtf file and not .vmt. Works only if Color Mode
value is 1DGradTexture
.
colorTop
will use texture itself to render, colorBottom
will use main color of chosen texture to render.
htZColStart
will set texture position. htZColEnd
will scale texture.
htZStart
will set main color start position, htZEnd
will scale main color.
With Global
and GlobalWithSky
xog type, it will be applied only in world space. With SkyOnly
, it will be applied in skybox. If you want to have it for world space and sky together - you can use 2 entities as workaround, first xog will use Global
type, second will use SkyOnly
type.
|
|
- colorTop
(colortop)
<color255> - Xog top color.
|
- colorBottom
(colorbottom)
<color255> - Xog bottom color.
|
- distStart
(diststart)
<float> - distStart
Xog start draw distance.
|
- distEnd
(distend)
<float> - distEnd
Xog end draw distance.
|
- distDensity
(distdensity)
<float> - distDensity
Density of xog entity, only values from 0 to 1 works.
|
- opacityOffsetTop
(opacityoffsettop)
<float> - opacityOffsetTop
Offsets top color of xog.
|
- opacityOffsetBottom
(opacityoffsetbottom)
<float> - opacityOffsetBottom
Offsets bottom color of xog.
|
- htZStart
(htzstart)
<float> - htZStart
Height that xog starts rendering at.
|
- htZEnd
(htzend)
<float> - htZEnd
Height that xog stops rendering at.
|
- htZColStart
(htzcolstart)
<float> - htZColStart
Height that xog color starts rendering at. Results depend on htZColEnd
value.
|
- htZColEnd
(htzcolend)
<float> - htZColEnd
Height that xog color stops rendering at. Results depend on htZColStart
value.
|
- noise1ScrollSpeed
(noise1scrollspeed)
<vector> - Layer one, speed at which noise moves trough xog volume (X Y Z).
|
- noise1Tiling
(noise1tiling)
<vector> - Layer one, tiling speed at which noise moves trough xog volume (X Y Z).
|
- noise2ScrollSpeed
(noise2scrollspeed)
<vector> - Layer two, speed at which noise moves trough xog volume (X Y Z).
|
- noise2Tiling
(noise2tiling)
<vector> - Layer two, tiling speed at which noise moves trough xog volume (X Y Z).
|
- noiseContrast
(noisecontrast)
<float> - Contrast of xog.
|
- noiseMultiplier
(noisemultiplier)
<float> - Multiplier of xog.
|
- RadiusX
(radiusz)
<float> - RadiusX
- RadiusY
(radiusy)
<float> - RadiusY
- RadiusZ
(radiusz)
<float> - RadiusZ
xogscripts.cfg
. The same have env_cascade_volume
.
skyColorTop!FGD(skycolortop)
<color255>- Deprecated. Xog top color in skybox. Can be found in .vmf files of some xen levels. Use
colorTop
instead.
skyColorBottom!FGD(skycolorbottom)
<color255>- Deprecated. Xog bottom color in skybox. Can be found in .vmf files of some xen levels. Use
colorBottom
instead.
gtZColStart!FGD(gtzcolstart)
<color255>- Deprecated. gtZColStart. Can be found in .vmf files of some xen levels.
gtZColEnd!FGD(gtzcolend)
<color255>- Deprecated. gtZColEnd. Can be found in .vmf files of some xen levels.
Inputs
TurnOn
<void>- Turn the xog on.
TurnOff
<void>- Turn the xog off.
Toggle
<void>- Toggle the xog current state.
Base:
AddContext
<string>- Adds to the entity's list of response contexts. See Context.
AddOutput
<string>- Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:
// Format of changing KeyValues: "AddOutput [key] [value]"
//// Raw text:
"OnUser1" "!self,AddOutput,targetname new_name"
// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
|
ClearContext
- Removes all contexts from this entity's list.
ClearParent
- Removes this entity from the the movement hierarchy, leaving it free to move independently.
FireUser1
toFireUser4
- Fires the respective
OnUser
outputs; see User Inputs and Outputs.
Kill
- Removes this entity and any entities parented to it from the world.
KillHierarchy
- Functions the same as
Kill
, although this entity and any entities parented to it are killed on the same frame, being marginally faster thanKill
input.
RemoveContext
<string>- Remove a context from this entity's list. The name should match the key of an existing context.
SetParent
<string>- Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment
<string>- Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset
<string>- As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
DispatchResponse
<string> !FGD- Dispatches a response to the entity. See Response and Concept.
DispatchEffect
<string> (removed since ) !FGD- Dispatches a special effect from the entity's origin; See also List of Client Effects. Replaced by the particle system since .
RunScriptFile
<script> (in all games since ) (also in )- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode
<string> (in all games since ) (also in )- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. Bug:In Hammer, using string arguments will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.Fix:Remove the string argument manually with a text editor.
CallScriptFunction
<string> (in all games since ) (also in ) !FGD- Calls a VScript function defined in the scope of the receiving entity.
TerminateScriptScope
(only in ) !FGD- Destroys the script scope of the receving entity.
SetLocalOrigin
<coordinates> (in all games since ) !FGD- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
Outputs
Base:
OnUser1
toOnUser4
- These outputs each fire in response to the firing of the like-numbered
FireUser1
toFireUser4
Input; see User Inputs and Outputs.
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.
No $translucent. Behind the wall placed xog volume and some models with small room.
With $translucent. Now player see everything, but only what in xog.
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.
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.
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.
Xog incorrect work with -tools
If you don't use Full Screen
- xog will incorrectly applying to screen.
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.
An example with newxog_volume.
An example with newxog_global.
This is why underwater plants in some xen levels so weird refracting if.
If model with refraction behind wall with refraction - this cause issues like this.
Similar issue with cloak material shader parameter.
An example with npc_human_assassin.
Sky xog works incorrectly with newxog_volume
Both GlobalWithSky
and SkyOnly
always fully shows through xog volumes.
SkyOnly buggy
SkyOnly
type have weird triangles.
Overwater layer
You can note a strange layer when submerging in water.
See also
- Xog Editor - the console-based xog editor.
newxog_volume
- xog volume brush entity with ellipsoid and box shapes support.newxog_settings
- entity that can change xog settings.env_fog_controller
fog_volume
- Fog tutorial
- Fog Basics
- Dust, Fog, & Smoke
- Color Correction
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)