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
+1 -1
View File
@@ -29,5 +29,5 @@ float4 fragmentMain(in FragmentParameter params) : SV_Target
{
result += pLightEnv.pointLights[i].illuminate(lightingParams, brdf);
}
return float4(params.vertexColor, 1.0f);
return float4(result, 1.0f);
}
+1 -2
View File
@@ -51,7 +51,7 @@ void taskMain(
{
uint m = mesh.meshletOffset + i;
MeshletDescription meshlet = pScene.meshletInfos[m];
if(meshlet.boundingBox.insideFrustum(localToClip, viewFrustum))
//if(meshlet.boundingBox.insideFrustum(localToClip, viewFrustum))
{
uint index;
InterlockedAdd(head, 1, index);
@@ -120,7 +120,6 @@ void meshMain(
{
uint vertexIndex = pScene.vertexIndices[m.vertexOffset + v];
VertexAttributes attr = pVertexData.getAttributes(md.indicesOffset + vertexIndex);
attr.vertexColor = m.color;
vertices[v] = attr.getParameter(inst.transformMatrix);
}
}
+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;
}
}
};