So I implemented deferred Shading with a single full screen light pass (picture 2) (by passing the light-data as an array to the shader) and deferred shading with point light volumes (picture 1) (by rendering the back faces of spheres with the radius of the light). To “add” the color of two separate lights i used blending
glCullFace(GL_FRONT); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE);
(while in the single light pass i just added the light values to the rgb color)
Else both light calculations are the same.
Yet i get those weird “lines” where one pixel is being lit by more than one light source, whereas the single pass results in a smooth transition.
I guess the problem is the blending equation, but i can’t find a solution.
The resulting color of the light volume shader looks like this
//d is the normal/light direction equation //sp is the specular value //att is the attenuation //diff is the material color color = vec4(diff * light_color * (d + sp) * att, 0.0);
The described values should be right.