EyeRefract
![English (en) English (en)](/w/images/3/37/Flag-en.png)
This article is about the shader. For the preceding shader, see
Eyes
. For the QC property of $model
, see Eyeball./ For the tool, see qc_eyes.EyeRefract
is a vertex shader available in all Source games since
Source 2007. This shader is a successor to the
Eyes
shader from Source 2004. Like it, EyeRefract
is used to create life-like eyes, with more realistic shading, cornea parallax, and a wider set of supported effects than Eyes
.
![Icon-Bug.png](/w/images/thumb/b/b4/Icon-Bug.png/10px-Icon-Bug.png)
$emissiveblend
, it is not fully implemented and does not work properly.![Icon-Bug.png](/w/images/thumb/b/b4/Icon-Bug.png/10px-Icon-Bug.png)
![Counter-Strike: Global Offensive](/w/images/thumb/8/85/Csgo_icon.png/16px-Csgo_icon.png)
![](/w/images/thumb/2/2e/Confirm.png/10px-Confirm.png)
![CS:GO engine branch](/w/images/thumb/8/85/Csgo_icon.png/16px-Csgo_icon.png)
![Icon-Bug.png](/w/images/thumb/b/b4/Icon-Bug.png/10px-Icon-Bug.png)
Eyes
shader, unless you're sure you can avoid these issues.Shader Parameters
The frame to start an animated
$iris
on.A texture to specify the shape of the cornea, similar to a normal map. Influences lighting and dilation. The red and green channels are used for the normal mapping, the blue channel is a mask for parallax mapping (straight multiply), and the alpha channel seems to be a multiplier for lighting. Because the
Todo: Requires more testing. Source code: eye_refract_ps2x.fxc - search for "fIrisHighlightMask"
$iris
is warped in various ways the normals will not match 1-to-1 with the base texture. ![Blank image.png](/w/images/b/ba/Blank_image.png)
Strength of the
$corneatexture.
How much the viewing angle should influence the positioning of the eye. Stronger values cause the iris to be smaller, but also move slower, making it seem "inset further". Default
0.25
.1-dimensional texture which remaps lighting colors.
The opacity of the cubemap reflection. Does not affect the eye glint. Default
0.5
.An ambient occlusion texture overlaid onto the entire eye (be sure to adjust the iris scale of the Eyeball in the QC to make it fit) to make it appear darker near the borders. The texture is multiplicative (white changes nothing, black turns the result darker).
Tints the
$ambientoccltexture
. Default "[0.33 0.33 0.33]"
.Strength of the dynamic ambient occlusion. Default
Todo: Strength for SSAO?
1
. ![Blank image.png](/w/images/b/ba/Blank_image.png)
Enables half-lambertian lighting.
Enables sphere raytracing. Each pixel is raytraced to allow sharper angles to look more accurate.
Requires
$raytracesphere 1
. Causes pixels which don't hit the raytraced sphere to be transparent, instead of rendering the "non-raytraced" eye behind it.Requires
$raytracesphere 1
. Radius of the eyeball. Should be the diameter of the eyeball divided by 2. Default 0.5
.Other Parameters
Eyeball origin. Most likely derived from the QC eyes definition.
Eyes are used on a model in
Half-Life 2: Episode One's intro cutscene. Adds another shader pass.
![Half-Life 2: Episode One](/w/images/thumb/0/0a/Hl2ep1_icon.png/32px-Hl2ep1_icon.png)
Requires
$intro 1
. How far into the warp animation we are.Requires
$intro 1
. World-space location of the entity, required to correctly animate the warp.![Blank image.png](/w/images/b/ba/Blank_image.png)
![Blank image.png](/w/images/b/ba/Blank_image.png)