some transparency
This commit is contained in:
@@ -5,6 +5,7 @@ interface IBRDF
|
||||
float3 evaluate(float3 viewDir_TS, float3 lightDir_TS, float3 lightColor);
|
||||
float3 evaluateAmbient();
|
||||
float getAlpha();
|
||||
float3 getTangentNormal();
|
||||
};
|
||||
|
||||
struct Phong : IBRDF
|
||||
@@ -40,6 +41,10 @@ struct Phong : IBRDF
|
||||
{
|
||||
return alpha;
|
||||
}
|
||||
float3 getTangentNormal()
|
||||
{
|
||||
return normal;
|
||||
}
|
||||
};
|
||||
|
||||
struct BlinnPhong : IBRDF
|
||||
@@ -75,6 +80,10 @@ struct BlinnPhong : IBRDF
|
||||
{
|
||||
return alpha;
|
||||
}
|
||||
float3 getTangentNormal()
|
||||
{
|
||||
return normal;
|
||||
}
|
||||
};
|
||||
|
||||
struct CelShading : IBRDF
|
||||
@@ -113,6 +122,10 @@ struct CelShading : IBRDF
|
||||
{
|
||||
return alpha;
|
||||
}
|
||||
float3 getTangentNormal()
|
||||
{
|
||||
return normal;
|
||||
}
|
||||
};
|
||||
|
||||
// https://learnopengl.com/PBR/Theory
|
||||
@@ -201,4 +214,8 @@ struct CookTorrance : IBRDF
|
||||
{
|
||||
return alpha;
|
||||
}
|
||||
float3 getTangentNormal()
|
||||
{
|
||||
return normal;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -49,6 +49,11 @@ struct FragmentParameter
|
||||
result.normal_TS = mul(tbn, normal_WS);
|
||||
return result;
|
||||
}
|
||||
float3x3 getTangentToWorld()
|
||||
{
|
||||
float3x3 tbn = float3x3(normalize(tangent_WS), normalize(biTangent_WS), normalize(normal_WS));
|
||||
return transpose(tbn);
|
||||
}
|
||||
#endif
|
||||
static FragmentParameter interpolate(FragmentParameter f0, FragmentParameter f1, FragmentParameter f2, float3 barycentricCoords)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user