blinn phong shading works

This commit is contained in:
Dynamitos
2023-12-03 23:12:20 +01:00
parent 178f48120d
commit 34e9304a3c
4 changed files with 14 additions and 12 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ struct LightingParameter
{
float3x3 tbn;
float3 position_WS;
float3 viewDir_WS;
float3 viewDir_TS;
};
// data passed to fragment shader
@@ -39,7 +39,7 @@ struct FragmentParameter
LightingParameter result;
result.tbn = float3x3(normalize(tangent_WS), normalize(biTangent_WS), normalize(normal_WS));
result.position_WS = position_WS;
result.viewDir_WS = normalize(viewDir_WS);
result.viewDir_TS = normalize(mul(result.tbn, viewDir_WS));
return result;
}
};