Is there a way to detect amount of light affecting some surface and use this value in a driver?

  • $\begingroup$ That would be in the shaders which do your lighting computation per material, but if those values are available from within the UI is another matter. $\endgroup$ Apr 28 '15 at 15:18
  • $\begingroup$ Did you ever got to a solution? I am looking to quantify how much light hits a plane and where as well, but I am stuck $\endgroup$
    – Bidon
    Apr 4 '20 at 19:07

Blender shaders or objetcs does not have this kind of output to use in drivers.

You can use the Inverse square law.

$$ I \propto \frac{1}{d^{2}} $$

Where $I$ is the intensity and $d$ is the distance. (Intensity is proportional to inverse of distance squared)

You can use this in your driver multiplied with the lamp or emission-shader intensity.

To account for surface normal (how it is rotated towards light) you would have to script a pydriver and access the mesh data inside: How to create a PyDriver in blender 2.7

Or use a dummy plane tangent to surface that will not render and get the direction and distance into the driver from there.

If you would like to account for mirrors or indirect lighting in general then forget it;)

  • $\begingroup$ Thought embedding Latex formula like Intensity \propto \frac{1}{distance^{2}}is a standard feature at all stackexchange sites, but I can't preview it here. Maybe it's only supported at math.stackexchange... Anyway, I've created an image of the formula for this answer, if you want to use it: i.stack.imgur.com/w8wI0.gif with this online tool. $\endgroup$
    – p2or
    Apr 28 '15 at 18:46
  • $\begingroup$ Not very optimistic answer but thank you) I wanted to do this for indirect lightning as well =( $\endgroup$
    – Terion
    Apr 28 '15 at 20:45
  • $\begingroup$ @ВладимирКорнилов Well technically you could do that but it would be the same as scripting your own renderer.. or you would have to somehow connect OSL scripted shaders to pydrivers.. $\endgroup$ Apr 28 '15 at 20:50
  • $\begingroup$ I understand) Well, I think I can handle my task with shaders only. Thank you again) $\endgroup$
    – Terion
    Apr 28 '15 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.