1
$\begingroup$

Is anyone aware of a way to access the illumination of a face of a given object?

As in, given this scene with a light source and a mesh; how much light hits any one face of that mesh.

I realize this might be an over-simplified question, but I just can't find anything related to this in the docs.

I don't expect an exact answer, just the correct terminology, or a hint on where in the docs I should be looking.

Some Context

I'm not using this to render an image; I'm building a generative algorithm, and I want to make this algorithm manipulate positions of faces based on the amount of light they "receive".

$\endgroup$
4
  • $\begingroup$ Is this process called "rendering"? You can access the result image to get the illumination information. If you want your illumination information stored in a specific format(e.g. in a physically based manner), you may write your own integrator, which is a component in rendering engine(such as cycles). $\endgroup$ Commented Jan 26, 2015 at 14:44
  • $\begingroup$ I suppose you might be able to access this via the rendering engine somehow. But I'm not actually using this to render. I'm building a generative algorithm, and I want to make this algorithm manipulate positions of faces based on the amount of light they "receive". $\endgroup$ Commented Jan 26, 2015 at 14:47
  • $\begingroup$ I think the easiest way is to bake the lighting into a texture and access the texture. Also old Blender builds (I think until 2.49b) had a feature called Radiosity Rendering which is a finite element approximation of global illumination. I am not sure if you can access the data from radiosity rendering but you might want not check it out. $\endgroup$
    – maddin45
    Commented Jan 27, 2015 at 12:01
  • $\begingroup$ @maddin45 thanks for the hints. Both baking and Radiosity sound like things I should look into. I was completely unaware of both of these functions. $\endgroup$ Commented Jan 27, 2015 at 12:07

1 Answer 1

0
$\begingroup$

It seems to me that what I asked is not easily done. As suggested by @maddin45 you can use baking. This looks complicated to script and I discarded this idea. The other suggestion of using Radiosity Rendering is out because Radiosity Rendering does not seem to be available in the newer releases of Blender.

My solution is to use ray casts. By casting a ray from every face towards my light source(s) I can see if the light source can be "seen" from that face, or if it is blocked by the structure I'm manipulation. This is a very simplistic approach to figure out something about how much light hits the face. The approximation can be improved by calculating the area of the face and taking the difference between the face normal and the vector pointing from the face centroid towards the light source into account. For my use this seems to be working quite well. Which is to say that it seems to be fast enough and accurate enough for my use.

I welcome any other suggestions for doing this.

$\endgroup$
1
  • $\begingroup$ I'd like to be able to select faces based on the amount of light they receive, if it is "zero" light like internal faces then i delete them. I'm trying to solve this here blender.stackexchange.com/questions/282161/… $\endgroup$
    – Harry McKenzie
    Commented Dec 25, 2022 at 2:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .