Hello everyone. Please tell me how to find out how much an object is illuminated. For example, I need sunlight to charge the energy and in the shadow of its spending?
I would probably start by performing a line trace from the solar collector in the opposite direction of the of the directional light. If the line trace hits anything other than your sky box, you’re in shadow.
A single trace won’t work very well with large objects, so you can just add more trace calls. You could use the bounds or surface of the object to start your traces at different locations and take an average of all sample traces to get your intensity.
Yes, the line tracing works, I’ve done that, but I need to know exactly the amount of light received. On the scene can not only be directional light source, there may be point sources. It is desirable, it is necessary to know the amount of light. In an extreme case, I will use a line tracing.