i’d like to add automatic exposure control to my renderer. afaik i need the average brightness of the scene. so i render the scene to a texture and then blit it to a texture half the size of the preceding one until i arrive at one which is 1x1.
how can i compute the exposure now? in a paper on this topic i found this:
Automatic exposure control aims to adjust the average brightness of the scene. The idea is that the average brightness of the scene should be around 0.5 because the displayable intensity range is from zero to one. If the average brightness is known, the exposure value can be determined with
Exposure = 0.5 / Average_Brightness;
Keep in mind that you wish the exposure to slowly adapt and not change instantaneously. To do this, you could use the following code:
Exposure = lerp(Exposure, 0.5 / Average_Brightness, Exposure_Adjust_Speed);
does this make sense? it gives chaotic results for me, with the screen sometimes being plain white or black. any ideas?