Shader updates
This commit is contained in:
parent
b0d08d27fd
commit
eb569a4263
|
@ -57,9 +57,14 @@ void main()
|
|||
// normal of fragment
|
||||
vec3 normalView = imageLoad(normals, globalThread).rgb;
|
||||
|
||||
// light layer index
|
||||
uint lightLayer = imageLoad (lightLayerData, globalThread).r;
|
||||
|
||||
vec3 fragColor = vec3 (0.0f);
|
||||
|
||||
for (int i = 0; i < lightCounts.directionalLights; ++i)
|
||||
{
|
||||
if ((lightLayer & DirLightData.dLightData[i].cullingMask) != 0)
|
||||
{
|
||||
// get normalized direction of light
|
||||
vec3 dLightNormalized = normalize (DirLightData.dLightData[i].direction);
|
||||
|
@ -70,13 +75,17 @@ void main()
|
|||
// Calculate the fragment color
|
||||
fragColor += DirLightData.dLightData[i].diffuseColor.rgb * diffuseStrength.rrr * pixelDiffuse;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < lightCounts.ambientLights; ++i)
|
||||
{
|
||||
if ((lightLayer & AmbLightData.aLightData[i].cullingMask) != 0)
|
||||
{
|
||||
// Just do some add
|
||||
//fragColor += pixelDiffuse.rgb * AmbLightData.aLightData[i].ambientColor.rgb * vec3 (0.5f);
|
||||
fragColor += pixelDiffuse.rgb * AmbLightData.aLightData[i].ambientColor.rgb * vec3 (AmbLightData.aLightData[i].strength);
|
||||
}
|
||||
}
|
||||
|
||||
float ssaoVal = imageLoad (ssaoBlurredImage, globalThread).r;
|
||||
fragColor *= ssaoVal;
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue