Now able to import stuff properly

This commit is contained in:
Dynamitos
2024-05-06 18:36:16 +02:00
parent 05bb1d0cee
commit af7d624d06
21 changed files with 189 additions and 79 deletions
+5 -5
View File
@@ -33,21 +33,21 @@ struct PointLight : ILightEnv
return illuminance * brdf.evaluate(params.tbn, params.viewDir_TS, -normalize(lightDir_TS), colorRange.xyz);
}
bool insidePlane(Plane plane, float3 position_VS)
bool insidePlane(Plane plane, float3 position)
{
return dot(plane.n, position_VS) - plane.d < -colorRange.w;
return dot(plane.n, position) - plane.d < -colorRange.w;
}
bool insideFrustum(Frustum frustum, float3 position_VS, float minDepth, float maxDepth)
bool insideFrustum(Frustum frustum, float3 position, float minDepth, float maxDepth)
{
bool result = true;
if(position_VS.z - colorRange.w > minDepth || position_VS.z + colorRange.w < maxDepth)
if(position.z - colorRange.w > minDepth || position.z + colorRange.w < maxDepth)
{
result = false;
}
for(int i = 0; i < 4 && result; ++i)
{
if(insidePlane(frustum.sides[i], position_VS))
if(insidePlane(frustum.sides[i], position))
{
result = false;
}