mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
46 lines
1.4 KiB
Text
46 lines
1.4 KiB
Text
uniform sampler2D _BumpMap;
|
|
uniform lowp vec4 _LightColor0;
|
|
uniform sampler2D _MainTex;
|
|
uniform mediump float _Shininess;
|
|
varying mediump vec2 xlv_TEXCOORD0;
|
|
varying mediump vec3 xlv_TEXCOORD1;
|
|
varying lowp vec3 xlv_TEXCOORD2;
|
|
varying lowp vec3 xlv_TEXCOORD3;
|
|
void main ()
|
|
{
|
|
lowp vec4 c_1;
|
|
lowp vec4 tmpvar_2;
|
|
tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
|
|
lowp vec3 tmpvar_3;
|
|
tmpvar_3 = ((texture2D (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0);
|
|
lowp vec3 halfDir_4;
|
|
halfDir_4 = xlv_TEXCOORD1;
|
|
lowp vec4 c_5;
|
|
lowp float spec_6;
|
|
lowp float tmpvar_7;
|
|
tmpvar_7 = max (0.0, dot (tmpvar_3, halfDir_4));
|
|
mediump float tmpvar_8;
|
|
tmpvar_8 = pow (tmpvar_7, (_Shininess * 128.0));
|
|
spec_6 = (tmpvar_8 * tmpvar_2.w);
|
|
c_5.xyz = (((
|
|
(tmpvar_2.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2)))
|
|
+ spec_6) * _LightColor0.xyz) * 2.0);
|
|
c_5.w = 0.0;
|
|
c_1.w = c_5.w;
|
|
c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * xlv_TEXCOORD3));
|
|
gl_FragData[0] = c_1;
|
|
}
|
|
|
|
|
|
// stats: 16 alu 2 tex 0 flow
|
|
// inputs: 4
|
|
// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
|
|
// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1]
|
|
// #2: xlv_TEXCOORD2 (low float) 3x1 [-1]
|
|
// #3: xlv_TEXCOORD3 (low float) 3x1 [-1]
|
|
// uniforms: 2 (total size: 0)
|
|
// #0: _LightColor0 (low float) 4x1 [-1]
|
|
// #1: _Shininess (medium float) 1x1 [-1]
|
|
// textures: 2
|
|
// #0: _BumpMap (low 2d) 0x0 [-1]
|
|
// #1: _MainTex (low 2d) 0x0 [-1]
|