I want to avoid IBL (image based lighting), however my scenes are way too dark - especially close-to-mirror like surfaces, which get little contributions from other direct light sources in the scene.

So I was thinking that I should add some sort of scene light - with single color defined in the scene. How do I calculate the contribution of such light based on normal and view directions, material albedo, roughness and metallness, and the scene color? Is there any standard or typical equation for that?

Note that I would like it view-dependant.

Edit: roughness/metallic balls All the balls in this picture should have approximately the same apparent brightness, but the smooth metal balls are way darker.

I am using smith+ggx brdf, possibly modified. Here is the whole fragment shader: https://gist.github.com/malytomas/b882c27c324a4f27ff56780717c9e4b2#file-cage_shader_engine_standard-glsl_fragment-glsl-L347 Line 347 is where I would like to add additional term to compensate for the absence of IBL.

  • $\begingroup$ Which BRDF are you using at the moment? Ambient light is independent of view and normals. It represents light that is homogeneously distributed in the world you are rendering. Have you ever taken a look at diffuse light? Its strength depends on the angle between the normal direction and the light direction. For view-dependent lighting like reflections, you should look at specular lighting. Can you show us your rendering result so we can see what seems to be missing? $\endgroup$
    – Thomas
    Commented Mar 2, 2023 at 9:26
  • $\begingroup$ @Thomas good idea - I have added a screenshot to the question. $\endgroup$
    – Tomas
    Commented Mar 2, 2023 at 10:43
  • $\begingroup$ Make sure you are not using a linear color space and that you are using gamma correction. Aside from better image quality, both of these will allow for brighter lightsources without color clipping. For your scene light, do you mean a hero light? Or do you mean some GI approximation? $\endgroup$
    – Mathis
    Commented Mar 4, 2023 at 16:10
  • $\begingroup$ @Mathis My rendering is gamma correct. Hero light is like a spot light attached to the camera, right? I am using that (not in the picture above) and it is kind-of ok-ish. Essentially, I am looking for an equation that calculates the amount of light that a metallic-smooth object receives from mirroring the scene. Something similar to how energy preservation equalizes between diffuse and specular. An equation that equalizes all three diffuse+specular+mirror. If that makes any sense... I think GI would be too expensive for my use-case, same as IBL. $\endgroup$
    – Tomas
    Commented Mar 5, 2023 at 17:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.