Moderator elections are being held. See Valve Developer Community:Moderator elections for more details.
Users who would like to run for moderator must be autoconfirmed and have at least 100 edits. Users can check their own edit count at Special:Preferences.

newxog_volume

From Valve Developer Community
Jump to: navigation, search

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

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.


Warning.pngWarning:Xog use expensive gbuffer, that means that with this entity your scene rendering at least 5 times, which makes your level very expensive, considering that XenEngine uses 32-bit architecture and DirectX 9 rendering. In large quantities, xog entities can greatly heat up your computer and also cause large FPS drops (depending on difficulty of your map and how your area open). Use wisely.

Black Mesa Represented by class CNewXogVolume.

Black Mesa Level Creation
English (en)
Edit

Keyvalues

Enabled (Enabled) <choices>
Enable/Disable this Entity.

Determines is this entity enabled or disabled on spawn.

  • 0: Enabled
  • 1: Disabled
Shape Type (xogtype) <choices>
Determines shape type that use xog volume, BBOX or Ellipsoid.
  • 0:0: LocalVolume BBOX
  • 1:1: LocalVolume Ellipsoid
Examples


colorMode (colormode) <choices>
Determines color mode.
  • 0:0:StaticColor
  • 1:1:1DGradTexture
  • 2:2: CubeGradTexture
Texture name Grad Texture (texname) <string>
Xog gradient texture name. The default is xen/effects/xen_sky_6_blurred_32.
colorTop (colortop) <color255>
Xog top color. This is the main color of xog that uses if Enable Height Blend KV 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>
distDensity

Density of xog entity, only values from 0 to 1 works.

Examples


opacityOffsetTop (opacityoffsettop) <float>
opacityOffsetTop

Offsets top color of xog.

Examples


opacityOffsetBottom (opacityoffsetbottom) <float>
opacityOffsetBottom

Offsets bottom color of xog.

Examples


htZStart (htzstart) <float>
htZStart

Height that xog starts rendering at.

Examples


htZEnd (htzend) <float>
htZEnd

Height that xog stops rendering at.

Examples


htZColStart (htzcolstart) <float>
htZColStart

Height that xog color starts rendering at. Results depend on htZColEnd value.

Examples


htZColEnd (htzcolend) <float>
htZColEnd

Height that xog color stops rendering at. Results depend on htZColStart value.

Examples


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


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


noise2ScrollSpeed (noise2scrollspeed) <vector>
Layer two, speed at which noise moves trough 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>
Enable/Disable this heightbased xog.

Determines bottom color and blending is disabled or enabled.

  • 0: Disabled
  • 1: Enabled
Examples



Base:
Name (targetname) <string>
The name that other entities use to refer to this entity.
Parent (parentname) <targetname>
Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (parentname [targetname],[attachment])
Tip.pngTip:Entities transition to the next map with their parents
Tip.pngTip:phys_constraint can be used as a workaround if parenting fails.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Note.pngNote:Hammer does not move the entities accordingly only in the editor.
Pitch Yaw Roll (X Y Z) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note.pngNote:This works on brush entities, although Hammer doesn't show the new angles.
Classname (classname) <string> !FGD
Determines the characteristics of the entity before it spawns.
Tip.pngTip:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
Spawnflags (spawnflags) <flags> !FGD
Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
Effects (effects) <flags> !FGD
Combination of effect flags to use.

Flags


BaseTrigger:
  •  [1] : Clients (Survivors, Special Infected, Tanks Left 4 Dead series)
  •  [2] : NPCs (Common Infected, Witches Left 4 Dead series)
  •  [8] : Physics Objects
  •  [16] : Only player ally NPCs
  •  [32] : Only clients in vehicles
  •  [64] : Everything (not including physics debris)
  •  [512] : Only clients *not* in vehicles
  •  [1024] : Physics debris
  •  [2048] : Only NPCs in vehicles (respects player ally flag)
  •  [4096] : Disallow Bots (removed since Left 4 Dead)

Inputs

TurnOn <void>
Turn xog on.
TurnOff <void>
Turn xog off.

BaseTrigger:
Toggle
Toggles this trigger between enabled and disabled states.
Enable
Enable trigger
Disable
Disable trigger
TouchTest  (in all games since Source 2007)
Triggers either the OnTouching or OnNotTouching outputs for whether anything is touching this entity.
StartTouch  (in all games since Source 2007) !FGD
Behave as if the !caller entity had just entered the trigger volume. Accepts non-physical entities.
EndTouch  (in all games since Source 2007) !FGD
Behave as if !caller had just exited the trigger volume.
DisableAndEndTouch  (only in Source 2013 Multiplayer(Team Fortress 2))
Disables this trigger and calls EndTouch on all currently-touching entities.

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 to FireUser4
Fires the respectiveOnUseroutputs; 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 thanKillinput.
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.
Use  !FGD
Same as a player invoking +use; no effect in most cases.
DispatchResponse <string> !FGD
Dispatches a response to the entity. See Response and Concept.
DispatchEffect <string> (removed since Left 4 Dead) !FGD
Dispatches a special effect from the entity's origin; See also List of Client Effects. Replaced by the particle system since Left 4 Dead.
RunScriptFile <script> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
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 Left 4 Dead 2) (also in Team Fortress 2)
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.
Icon-Bug.pngBug:In Hammer, using string arguments will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.
Note.pngFix:Remove the string argument manually with a text editor.
Note.pngNote:Team Fortress 2 Backtick characters ` are replaced with quotation marks at runtime, allowing quotation marks to be used when normally not possible.
CallScriptFunction <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2) !FGD
Calls a VScript function defined in the scope of the receiving entity.
TerminateScriptScope  (only in Team Fortress 2) !FGD
Destroys the script scope of the receving entity.
SetLocalOrigin <coordinates> (in all games since Alien Swarm) !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.
SetLocalAngles <angles> (in all games since Alien Swarm) !FGD
Set this entity's angles.

Outputs

BaseTrigger:

OnStartTouch
Fired when a valid entity starts touching this trigger. !activator is whatever touches the trigger.
Icon-Bug.pngBug:Spamming crouch jumps in a trigger can randomly fire OnStartTouch.
Confirm:Is it a Multiplayer issue only?


OnStartTouchAll
Fired when a valid entity starts touching this trigger, and no other entities are touching it. If there are any other entities touching the trigger when a new one begins to touch, only OnStartTouch will fire.
OnEndTouch
Fired when a valid entity stops touching this trigger.
Warning.pngWarning:This includes entities which are deleted while inside the trigger. In this case !activator will be invalid.
Warning.pngWarning:OnEndTouch can fire before OnStartTouch under certain circumstances where both are fired on the same tick and each have the same delay.
Fix: Add a slight delay to OnEndTouch.
Icon-Bug.pngBug:Spamming crouch jump in a trigger can randomly fire OnEndTouch.
Confirm:Is it a Multiplayer issue only?
OnEndTouchAll
Fired when all valid entities stop touching this trigger.
OnTouching  (in all games since Source 2007)
Fired if something is currently touching this trigger when TouchTest is fired.
OnNotTouching  (in all games since Source 2007)
Fired if nothing is currently touching this trigger when TouchTest is fired.

Base:

OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 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.

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