Pyree :
Use equation, use m for depth:
PARz = PAR0 * exp (-ε * z)
PARz: radiation at water depth z
PAR0: radiation entering the water surface
ε: parameter for underwater light extinction, affected by dissolved and suspended matter
z: specific water depth
Since you only need percentage, use PAR0=100 and gives you 100% at depth 0.
Parameter for underwater light extinction ε use 0.3 which is clear water.
You mentioned other sources told you that you still get 1% light at 100m depth and you may wonder why my equation gives you 1% light at 15m depth. This is because blue light may penetrate that deep but all the other light we see don't penetrate nearly as deep. So the useful light we see is pretty much limited to about 15m.
I am a marine biologist.
I got
that information here. 100 meters has 0.53% light penetration given that site which is the closest I got. So then, basically, all I need is this:
BlackOpacity = (BYTE)(255.5-(255.0*exp(-0.3*Depth)));
ActualOpacity = (BYTE)BaseOpacity;
BaseOpacity is the opacity of an all-black image that otherwise covers the entire screen - the higher the opacity, the darker the scene. Given this (plugging it in to Excel first), something is far from correct - a depth of 100 meters has 9.21E-12% of the original light, way off. At 10 meters depth, the kinds of depths scuba divers go to (if I recall), of which I know is still very light, has a tiny 4.98% of the original light, next to nothing. It's like getting 4 1/2 times further from a single light source. If I change ε to 0.0528, I get something closer to what that one source states for 100 meters. If I change ε to 0.1505, I match that of that source's 10-meter depth data. I'm assuming that depth is also in meters, as per the scientific standard. Perhaps that one site's formula is based on the blue light that can penetrate this deep rather than the more useful light (like red)? Something is strange here.
My game won't be finished for another year yet, unfortunately, considering it's only half finished. I spent 5 or so hours searching Google for this formula so I had a more realistic water darkening effect, especially for the ocean-themed world that drops down about 90 meters below the surface.