shader adjustments

This commit is contained in:
2026-03-15 22:37:08 +01:00
parent cd0f6d038f
commit 9109baad18
10 changed files with 172 additions and 105 deletions
+11
View File
@@ -1,5 +1,6 @@
import Common;
import MaterialParameter;
import Frustum;
interface ILightEnv
{
@@ -81,6 +82,8 @@ interface IBRDF
float3 evaluateAmbient(float3 viewDir_WS);
float getAlpha();
float3 getEmissive();
float getRoughness();
float getMetallic();
[mutating] void setNormal(float3 n);
};
@@ -134,6 +137,8 @@ struct Phong : IBRDF
{
return emissive;
}
float getRoughness() { return pow(2.0 / (shininess + 2.0), 0.25); }
float getMetallic() { return 0; }
[mutating] void setNormal(float3 n) { normal = n; }
};
@@ -187,6 +192,8 @@ struct BlinnPhong : IBRDF
{
return emissive;
}
float getRoughness() { return pow(2.0 / (shininess + 2.0), 0.25); }
float getMetallic() { return 0; }
[mutating] void setNormal(float3 n) { normal = n; }
};
@@ -240,6 +247,8 @@ struct CelShading : IBRDF
{
return emissive;
}
float getRoughness() { return 1.0; }
float getMetallic() { return 0; }
[mutating] void setNormal(float3 n) { normal = n; }
};
@@ -364,5 +373,7 @@ struct CookTorrance : IBRDF
{
return emissive;
}
float getRoughness() { return roughness; }
float getMetallic() { return metallic; }
[mutating] void setNormal(float3 n) { normal = n; }
};