Fixing skybox

This commit is contained in:
Dynamitos
2024-01-02 16:48:03 +01:00
parent 4b58ab84be
commit 1ff3ddf9a3
11 changed files with 159 additions and 49 deletions
+20 -13
View File
@@ -34,23 +34,30 @@ struct BlinnPhong : IBRDF
}
};
struct DisneyBRDF : IBRDF
struct CelShading : IBRDF
{
float3 baseColor;
float metallic = 0;
float3 normal = float3(0, 1, 0);
float subsurface = 0;
float specular = 0.5;
float roughness = 0.5;
float specularTint = 0;
float anisotropic = 0;
float sheen = 0;
float sheenTint = 0.5f;
float clearCoat = 0;
float clearCoatGloss = 1;
float3 normal;
__init()
{
normal = float3(0, 0, 1);
}
float3 evaluate(float3x3 tbn, float3 viewDir_TS, float3 lightDir_TS, float3 lightColor)
{
return baseColor;
float3 normal_TS = normalize(normal);
float nDotL = dot(normal_TS, lightDir_TS);
float diffuse = max(nDotL, 0);
float3 darkenedBase = baseColor * 0.8;
if(diffuse > 0.5)
{
return baseColor * lightColor;
}
else
{
return darkenedBase * lightColor;
}
}
};