mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 00:31:28 -05:00
35 lines
868 B
Text
35 lines
868 B
Text
uniform float _Fresnel;
|
|
uniform float _SpecIntensity;
|
|
varying vec3 inN;
|
|
varying vec3 inE;
|
|
void main ()
|
|
{
|
|
vec3 p_1;
|
|
float factor_2;
|
|
float tmpvar_3;
|
|
tmpvar_3 = (1.0 - min (max (
|
|
dot (inN, inE)
|
|
, 0.0), 1.0));
|
|
vec3 tmpvar_4;
|
|
tmpvar_4.x = 1.0;
|
|
tmpvar_4.y = tmpvar_3;
|
|
tmpvar_4.z = ((tmpvar_3 * tmpvar_3) * tmpvar_3);
|
|
p_1.z = tmpvar_4.z;
|
|
vec2 tmpvar_5;
|
|
tmpvar_5.x = (1.0 - _Fresnel);
|
|
tmpvar_5.y = _Fresnel;
|
|
p_1.x = dot (tmpvar_4.xy, tmpvar_5);
|
|
p_1.y = dot (tmpvar_4.yz, tmpvar_5);
|
|
factor_2 = (0.05 + (0.95 * dot (p_1.xy, tmpvar_5)));
|
|
factor_2 = (factor_2 * _SpecIntensity);
|
|
gl_FragColor = vec4(factor_2);
|
|
}
|
|
|
|
|
|
// stats: 14 alu 0 tex 0 flow
|
|
// inputs: 2
|
|
// #0: inN (high float) 3x1 [-1]
|
|
// #1: inE (high float) 3x1 [-1]
|
|
// uniforms: 2 (total size: 0)
|
|
// #0: _Fresnel (high float) 1x1 [-1]
|
|
// #1: _SpecIntensity (high float) 1x1 [-1]
|