"Software Engineer living in Newcastle-upon-Tyne, UK. Currently specialising in graphics, game engine and AR/VR development. Interested in all thing digital & slowly approaching the uncanny valley, one commit at a time!"
Demonstration of HLSL/CG shader programming in fur shader
void vert () { fixed mask = tex2Dlod (_FurTex, float4(v.texcoord.xy,0,0)); v.vertex.xyz += v.normal * _FurLength * FUR_MULTIPLIER * mask; } struct Input { float2 uv_MainTex; float3 viewDir; }; void surf (Input IN, inout SurfaceOutputStandard o) { fixed mask = tex2D (_FurTex, IN.uv_MainTex).r; o.Alpha = step(lerp(_Cutoff,_CutoffEnd,FUR_MULTIPLIER), mask); float alpha = 1 - (FUR_MULTIPLIER * FUR_MULTIPLIER); alpha += dot(IN.viewDir, o.Normal) - _EdgeFade; o.Alpha *= alpha; }