POV-Ray : Newsgroups : povray.windows : some question about windows cmd : Re: some question about windows cmd Server Time
18 Apr 2024 05:51:53 EDT (-0400)
  Re: some question about windows cmd  
From: Alain
Date: 4 Apr 2018 14:56:49
Message: <5ac51ff1@news.povray.org>
Le 18-04-04 à 09:32, 944291641 a écrit :
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>> "944291641" <944### [at] qqcom> wrote:
>>
>>> Recently I have encounter another question , could you give me a hand?
>>>
>>> I build a scene which contains some trees, and I want calculate the area of the
>>> sunlit leaf and the shaded leaf. For that I am a  Pov-Ray beginner, I don't know
>>> if there is any functions that can achieve this goal.
>>
>>
>>
>> Do you need to calculate that for ALL the leaves in a scene, or just one?
>>
>> You could probably render a single leaf, with a fairly artificial setup that
>> gives a certain color of final rendered pixel for lit, a certain color for
>> unlit, and a distinct background color (I'd go with transparent).
>>
>> Then you could scan and count the pixels of the different colors.
>>
>> Sorta like this:
>>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.58cfc0cf857600e8c437ac910%40news.povray.org%3E/?mtop=4161
> 51
>>
>>
>> POV-Ray has internal processes that count ray-object intersections, and there is
>> also trace () and eval_pigment ().
>>
>> Perhaps there's a way to determine how much total leaf area there is, how much
>> is directly lit, and then subtract lit from total.
> Thanks for you kindness, I have try to set the color of shaded leaf, but I
> failed.Could you give me a hand that how to setup the lit and the unlit in
> different color?
> 
> 
> 
> 

There is no reasonable way to assign a different colour to an object 
depending on whether it is lit or not. It's simply because the actual 
pigment is illumination independent.
To know if any point is illuminated or not, the only way is to trace 
from the light that interest you toward an union containing the surface 
that interest you and see if it get intercepted early.
You need to repeat for each point of your object, and it will get 
*really* long. For each point you need to compute the exact direction 
that may differ by only a fraction of arc second, perform the trace, 
check if the returned coordinate match that of your surface, then, 
somehow create a custom pattern based on that result.
Extremely long and error prone.

Without going through all that, when you render your scene, unlighted 
part will always be darker.
It's possible to get radically different colours by using the 
projected_through light option:

Set the ambient to zero everywhere.
Bind your whole scene into a big union.
Use a regular light that is coloured.
Use a second light using the complementary colour from the main light, 
place it at exactly the same location and make it projected_through 
using your union.

Now, every part of your scene that is in the shadow from the main light 
is illuminated only by the projected_through light with a totally 
different colour.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.