mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 00:31:28 -05:00
32 lines
804 B
Text
32 lines
804 B
Text
#include <metal_stdlib>
|
|
using namespace metal;
|
|
struct xlatMtlShaderInput {
|
|
half3 normal;
|
|
half3 halfDir;
|
|
};
|
|
struct xlatMtlShaderOutput {
|
|
half4 _fragData [[color(0)]];
|
|
};
|
|
struct xlatMtlShaderUniform {
|
|
half specPower;
|
|
};
|
|
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
|
|
{
|
|
xlatMtlShaderOutput _mtl_o;
|
|
half4 c_1;
|
|
half tmpvar_2;
|
|
tmpvar_2 = dot (_mtl_i.normal, _mtl_i.halfDir);
|
|
half4 tmpvar_3;
|
|
tmpvar_3 = half4(pow (tmpvar_2, _mtl_u.specPower));
|
|
c_1 = tmpvar_3;
|
|
_mtl_o._fragData = c_1;
|
|
return _mtl_o;
|
|
}
|
|
|
|
|
|
// stats: 2 alu 0 tex 0 flow
|
|
// inputs: 2
|
|
// #0: normal (low float) 3x1 [-1]
|
|
// #1: halfDir (low float) 3x1 [-1]
|
|
// uniforms: 1 (total size: 2)
|
|
// #0: specPower (medium float) 1x1 [-1] loc 0
|