Shaders are not compiling anymore...

This commit is contained in:
Dynamitos
2023-12-02 10:55:00 +01:00
parent 9114a6f252
commit 6c156d3bc2
23 changed files with 190 additions and 148 deletions
+1 -2
View File
@@ -17,10 +17,9 @@ ParameterBlock<LightCullingData> pLightCullingData;
[shader("pixel")]
float4 fragmentMain(in FragmentParameter params) : SV_Target
{
MaterialParameter materialParams = params.getMaterialParameter();
LightingParameter lightingParams = params.getLightingParameter();
let brdf = pMaterial.prepare(materialParams);
let brdf = pMaterial.prepare(params.getMaterialParameter());
float3 result = float3(0, 0, 0);
for(int i = 0; i < pLightEnv.numDirectionalLights; ++i)
{
+1 -1
View File
@@ -30,7 +30,7 @@ struct BlinnPhong : IBRDF
float3 h = lightDir_WS + viewDir_WS;
float specular = dot(normal_WS, h);
return lightDir_WS * 2 + float3(1, 1, 1);//baseColor * (diffuse + specular) * lightColor;
return baseColor * (diffuse + specular) * lightColor;
}
};
+4 -3
View File
@@ -35,14 +35,15 @@ struct Frustum
Plane basePlane;
bool pointInside(float3 point)
{
if (dot(basePlane.n, point) + basePlane.d < 0)
float result = dot(basePlane.n, point) + basePlane.d;
if (0.0f > result)
{
return false;
}
for(int p = 0; p < 4; ++p)
{
float result = dot(sides[p].n, point) + sides[p].d;
if(result < 0)
result = dot(sides[p].n, point) + sides[p].d;
if(0.0f > result)
{
return false;
}
+1 -1
View File
@@ -28,7 +28,7 @@ struct PointLight : ILightEnv
float3 lightDir_WS = position_WS.xyz - params.position_WS;
float d = length(lightDir_WS);
float illuminance = max(1 - d / colorRange.w, 0);
return brdf.evaluate(params.tbn, params.viewDir_WS, normalize(lightDir_WS), colorRange.xyz);
return illuminance * brdf.evaluate(params.tbn, params.viewDir_WS, normalize(lightDir_WS), colorRange.xyz);
}
bool insidePlane(Plane plane)