This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float Beckmann1(float3 n, float3 h, float m) | |
{ | |
float ndoth = saturate(dot(n, h)); | |
float cos2 = ndoth*ndoth; | |
return exp((cos2 - 1)/(cos2*m*m)); | |
} | |
// mul r0.x, cb0[2].x, cb0[2].x | |
// dp3_sat r0.y, cb0[0].xyzx, cb0[1].xyzx | |
// mul r0.z, r0.y, r0.y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Blending when n1 and n2 are already 'unpacked' and normalised | |
float3 blend_rnm_unpacked(float3 n1, float3 n2) | |
{ | |
float3 t = n1.xyz + float3( 0, 0, 1); | |
float3 u = n2.xyz * float3(-1, -1, 1); | |
float3 r = (t/t.z)*dot(t, u) - u; | |
return r; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PS_INPUT | |
{ | |
float4 Pos : VS_OUT_POSITION; | |
}; | |
// removing "const" fixes the problem | |
float4 Function(const float4 value) | |
{ | |
return value; | |
} |