This article's documentation is for anything that uses the Source engine. Click here for more information.

EyeRefract: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 7: Line 7:
{{Bug|On {{src13|3.1}}, it's been observed to cause issues when used in scenes with [[expensive]] [[water]], causing flickering and tears or disappearing of the water itself. It is advised to stick to the more stable {{code|Eyes}} shader, unless you're sure you can avoid these issues.}}
{{Bug|On {{src13|3.1}}, it's been observed to cause issues when used in scenes with [[expensive]] [[water]], causing flickering and tears or disappearing of the water itself. It is advised to stick to the more stable {{code|Eyes}} shader, unless you're sure you can avoid these issues.}}
== Shader Parameters ==
== Shader Parameters ==
{{MatParam|$iris|texture|The texture for the iris. The alpha channel controls the noisiness of the cornea.}}
{{MatParam|$iris|texture|The texture used for the iris. The alpha channel masks the iris against the sclera, which makes the iris more prominent. Opaque values mark the sclera, and transparent values mark the iris.}}
{{MatParam|$irisframe|int|The frame to start an animated <code>$iris</code> on.}}
{{MatParam|$irisframe|int|The frame to start an animated <code>$iris</code> on.}}
{{MatParam|$corneatexture|texture|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 <code>$iris</code> is warped in various ways the normals will not match 1-to-1 with the base texture. {{todo|Requires more testing. Source code: eye_refract_ps2x.fxc - search for "fIrisHighlightMask"}}}}
{{MatParam|$corneatexture|texture|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 <code>$iris</code> is warped in various ways the normals will not match 1-to-1 with the base texture. {{todo|Requires more testing. Source code: eye_refract_ps2x.fxc - search for "fIrisHighlightMask"}}}}

Revision as of 01:07, 1 August 2024

English (en)Translate (Translate)
Eyerefract.jpg
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 Source games since Source 2007 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.pngBug:Although this shader has support for $emissiveblend, it is not fully implemented and does not work properly.  [todo tested in ?]
Icon-Bug.pngBug:The shader doesn't work in Counter-Strike: Global Offensive Counter-Strike: Global Offensive, where eyes are always directed to the map's center. Standard models use static eyes.  [todo tested in ?]
Confirm:is this just CS:GO, or is it all CS:GO engine branch CS:GO engine branch games?
Icon-Bug.pngBug:On Source 2013, it's been observed to cause issues when used in scenes with expensive water, causing flickering and tears or disappearing of the water itself. It is advised to stick to the more stable Eyes shader, unless you're sure you can avoid these issues.  [todo tested in ?]

Shader Parameters

$iris $irisframe $corneatexture $corneabumpstrength $parallaxstrength $dilation $lightwarptexture $envmap $glossiness $ambientoccltexture $ambientocclcolor $ambientocclusion $halflambert $raytracesphere $spheretexkillcombo $eyeballradius

Other Parameters

$eyeorigin $irisu $irisv $intro $warpparam $entityorigin

Todo: Include cloak parameters in here?
Todo: Can this shader be used outside of a model with qc eyes, by using proxies (or in SFM override materials) to modify these shader values?