Difference between forward and deferred light

I have met the following problem. I have a custom light model. It’s completely duplicated into the shader for deferred lighting, _PrePass functions are realized, and everything should be working… Except for one thing. When using forward lighting, I get same results, but darker, visibly darker. I tested it on the same light source - roughly twice time the difference in light. I want to understand what’s going on behind the scenes. What’s the order and principles of mixing of results of “surf” function and lighting functions for both types of renderers. I don’t want the source code, just the basics - take this, multiply by that, put result on the screen. I still don’t get how it works.

There always bound to be quite minor differences. The fragment shader that also computes lighting in Forward gets the normal straight from the vertex shader and the spec/gloss info uncompressed from the map/material properties. In Deferred, those infos I think are encoded in G-buffers (aka temporary behind-the-scenes render-textures) with typically somewhat limited precision and then decoded in final composition. There’s some minor loss of information there but you wouldn’t know (especially the end user) unless you immediately switch back and forth between Forward & Deferred which shows the difference.

Nonetheless, the issue in your case might be something else altogether! But since you haven’t posted your lighting func, a “general random theory” is the best we can come up with.

Of course, to find out to the very last detail the differences in how shaders proceed in the 2 rendering paths, #pragma debug is your friend.