POV-Ray : Newsgroups : povray.advanced-users : Lighted vs unlighted texture Server Time: 29 Sep 2020 22:15:39 GMT
 Lighted vs unlighted texture (Message 1 to 10 of 13)
 From: Bald Eagle Subject: Lighted vs unlighted texture Date: 16 May 2017 16:40:00 Message:
I was talking with Stephen about some scene elements,
and was wondering if there were a way to have directly lighted surfaces of an
object show one texture, and any unlighted / indirectly lighted surfaces have
another.

The obvious way would be to construct the object in 2 parts - split by a plane
the light source is perpendicular to, and assign each half a different texture.
Though I was hoping for something a bit more elegant, easier, and allowing a
smoother transition.
 From: clipka Subject: Re: Lighted vs unlighted texture Date: 16 May 2017 17:07:24 Message: <591b31cc\$1@news.povray.org>
Am 16.05.2017 um 18:37 schrieb Bald Eagle:
> I was talking with Stephen about some scene elements,
> and was wondering if there were a way to have directly lighted surfaces of an
> object show one texture, and any unlighted / indirectly lighted surfaces have
> another.
>
> The obvious way would be to construct the object in 2 parts - split by a plane
> the light source is perpendicular to, and assign each half a different texture.
> Though I was hoping for something a bit more elegant, easier, and allowing a
> smoother transition.

Depending on what exactly you want to achieve, maybe the slope pattern
is good enough for your purposes.
 From: Kenneth Subject: Re: Lighted vs unlighted texture Date: 16 May 2017 22:05:00 Message:
Some hypothetical 'thought-questions':

1) What should happen if there are multiple light sources in the scene, coming
from different directions? One light will be filling in some of the shadow areas
produced by another light; in which case, what constitutes a true shadow?

2) Using only ONE light for simplicity's sake, and a spherical object, should
the 'fading light/shadow terminator' line on that shape be a continuous blend of
both textures, as the light 'disappears' into shadow around the side of the
sphere?

Off the top of my head, here are some (incomplete) thoughts about a possible
approach, when using only ONE light source-- and based on a 4-pass render!! The
scene is first rendered only in greyscale (with white pigments on everything.)
THEN the scene is rendered again with the FIRST real texture on all objects.
Then again with the SECOND real texture. At this point, you have three rendered
images.

The greyscale image is then run through POV-Ray again, using eval_pigment() to
get its grayscale values (1.0 for pure white, 0.0 for pure black, and all grey
values in-between.) Those values are somehow(!) used to pick which of the two
REAL-textured images to apply to a NEW re-rendered 2-D copy of the image, on a
pixel-by-pixel basis. Using lots of tiny flat boxes or polygon shapes for this.
(A function of some kind might be handy for doing this.) The 3-D scene is not
actually rendered again. In effect, this last step is just post-processing.
(I've actually done this for other kinds of scenes-- for example, to get a
pre-rendered image to explode into animated fragments.)

Actually, I can already see that this approach as-is would not produce the
correct *darkening* of the textures in the shadow areas. Maybe the eval_pigment
values could be used for that too.

--- Admittedly, this technique isn't much different from taking the three images
into Photoshop and using greyscale alpha masks to blend the images together.---
 From: Thomas de Groot Subject: Re: Lighted vs unlighted texture Date: 17 May 2017 07:00:11 Message: <591bf4fb\$1@news.povray.org>
On 16-5-2017 18:37, Bald Eagle wrote:
> I was talking with Stephen about some scene elements,
> and was wondering if there were a way to have directly lighted surfaces of an
> object show one texture, and any unlighted / indirectly lighted surfaces have
> another.
>
> The obvious way would be to construct the object in 2 parts - split by a plane
> the light source is perpendicular to, and assign each half a different texture.
> Though I was hoping for something a bit more elegant, easier, and allowing a
> smoother transition.
>
>
>
>

Would aoi (angle of incidence) be the answer?

--
Thomas
 From: clipka Subject: Re: Lighted vs unlighted texture Date: 17 May 2017 10:15:00 Message:
Thomas de Groot <tho### [at] degrootorg> wrote:
> On 16-5-2017 18:37, Bald Eagle wrote:
> > I was talking with Stephen about some scene elements,
> > and was wondering if there were a way to have directly lighted surfaces of an
> > object show one texture, and any unlighted / indirectly lighted surfaces have
> > another.
> >
> > The obvious way would be to construct the object in 2 parts - split by a plane
> > the light source is perpendicular to, and assign each half a different texture.
> > Though I was hoping for something a bit more elegant, easier, and allowing a
> > smoother transition.
> >
> >
> >
> >
>
> Would aoi (angle of incidence) be the answer?

No; `aoi` depends on the angle between the surface and the camera ray.
 From: Thomas de Groot Subject: Re: Lighted vs unlighted texture Date: 17 May 2017 11:04:21 Message: <591c2e35\$1@news.povray.org>
On 17-5-2017 12:13, clipka wrote:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>> On 16-5-2017 18:37, Bald Eagle wrote:
>>> I was talking with Stephen about some scene elements,
>>> and was wondering if there were a way to have directly lighted surfaces of an
>>> object show one texture, and any unlighted / indirectly lighted surfaces have
>>> another.
>>>
>>> The obvious way would be to construct the object in 2 parts - split by a plane
>>> the light source is perpendicular to, and assign each half a different texture.
>>> Though I was hoping for something a bit more elegant, easier, and allowing a
>>> smoother transition.
>>>
>>>
>>>
>>>
>>
>> Would aoi (angle of incidence) be the answer?
>
> No; `aoi` depends on the angle between the surface and the camera ray.
>
>
Would there be a way to 'tweak' this somehow?  I know that the obvious
answer is 'no' but I keep wondering...

--
Thomas
 From: William F Pokorny Subject: Re: Lighted vs unlighted texture Date: 17 May 2017 11:50:53 Message: <591c391d\$1@news.povray.org>
On 05/16/2017 12:37 PM, Bald Eagle wrote:
> I was talking with Stephen about some scene elements,
> and was wondering if there were a way to have directly lighted surfaces of an
> object show one texture, and any unlighted / indirectly lighted surfaces have
> another.
>
> The obvious way would be to construct the object in 2 parts - split by a plane
> the light source is perpendicular to, and assign each half a different texture.
> Though I was hoping for something a bit more elegant, easier, and allowing a
> smoother transition.
>
>
>
>
If the shapes / light involved are not too complex, perhaps using the
new to 3.7.1 user_defined pigment feature and layered textures where the
transmission value for the top texture{pigment} is set up to depend upon
the light to shape surface "aoi" relationship...

Bill P.
 From: Bald Eagle Subject: Re: Lighted vs unlighted texture Date: 17 May 2017 12:00:00 Message:
See animation posted in binaries/animations.

Looks like slope {point_at .....} works pretty well   :)
 From: clipka Subject: Re: Lighted vs unlighted texture Date: 17 May 2017 13:08:36 Message: <591c4b54\$1@news.povray.org>
Am 17.05.2017 um 13:04 schrieb Thomas de Groot:

>>> Would aoi (angle of incidence) be the answer?
>>
>> No; `aoi` depends on the angle between the surface and the camera ray.
>>
>>
> Would there be a way to 'tweak' this somehow?  I know that the obvious
> answer is 'no' but I keep wondering...

You mean, something like the `slope` pattern with the (new in 3.7)
`point_at` syntax? ;)
 From: Kenneth Subject: Re: Lighted vs unlighted texture Date: 17 May 2017 15:35:01 Message:
[somewhat off-topic...]

Sorry to ask a dumb question, but is the 'aoi' pattern the same as a 'proximity'
pattern? Do the two descriptors actually mean the same thing?