diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/stdshaders/eyeglint_ps2x.fxc | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'materialsystem/stdshaders/eyeglint_ps2x.fxc')
| -rw-r--r-- | materialsystem/stdshaders/eyeglint_ps2x.fxc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/eyeglint_ps2x.fxc b/materialsystem/stdshaders/eyeglint_ps2x.fxc new file mode 100644 index 0000000..bc39f07 --- /dev/null +++ b/materialsystem/stdshaders/eyeglint_ps2x.fxc @@ -0,0 +1,32 @@ +// ======= Copyright � 1996-2007, Valve Corporation, All rights reserved. ====== +// +// Run procedural glint generation inner loop in pixel shader (ps_2_0) +// +// ============================================================================= + +struct PS_INPUT +{ + float2 tc : TEXCOORD0; // Interpolated coordinate of current texel + float2 glintCenter : TEXCOORD1; // Uniform value containing center of glint + float3 glintColor : TEXCOORD2; // Uniform value of color of glint +}; + +float GlintGaussSpotCoefficient( float2 d ) +{ + return saturate( exp( -25.0f * dot(d, d) ) ); +} + +float4 main( PS_INPUT i ) : COLOR +{ + float2 uv = i.tc - i.glintCenter; // This texel relative to glint center + + float intensity = GlintGaussSpotCoefficient( uv + float2(-0.25f, -0.25f) ) + + GlintGaussSpotCoefficient( uv + float2( 0.25f, -0.25f) ) + + 5 * GlintGaussSpotCoefficient( uv ) + + GlintGaussSpotCoefficient( uv + float2(-0.25f, 0.25f) ) + + GlintGaussSpotCoefficient( uv + float2( 0.25f, 0.25f) ); + + intensity *= 4.0f/9.0f; + + return float4( intensity * i.glintColor, 1.0f ); +}
\ No newline at end of file |