POV-Ray : Newsgroups : povray.advanced-users : Realistic scattering Server Time
23 Nov 2024 09:55:27 EST (-0500)
  Realistic scattering (Message 1 to 10 of 10)  
From: IGM
Subject: Realistic scattering
Date: 6 Apr 2018 11:55:01
Message: <web.5ac7982fe8a61476776fc67d0@news.povray.org>
Hi,
I would like to render realistically a "diffusor sheet", like for example this:
https://www.inventables.com/technologies/light-diffuser-films

In povray, if I create a scattering media thin box, thanks to scattering media
the sheet becomes increasingly white, but I still see a light source, behind the
sheet, sharply defined. In other word, I need to obtain a blurred source behind
the sheet.

Do you have any suggestion to reach this result?
Thank you

igmar


Post a reply to this message

From: clipka
Subject: Re: Realistic scattering
Date: 6 Apr 2018 13:05:34
Message: <5ac7a8de$1@news.povray.org>
Am 06.04.2018 um 17:54 schrieb IGM:
> Hi,
> I would like to render realistically a "diffusor sheet", like for example this:
> https://www.inventables.com/technologies/light-diffuser-films
> 
> In povray, if I create a scattering media thin box, thanks to scattering media
> the sheet becomes increasingly white, but I still see a light source, behind the
> sheet, sharply defined. In other word, I need to obtain a blurred source behind
> the sheet.

You can model an ideal diffuser sheet using a patch primitive (such as a
triangle, an open mesh or a bezier patch*), and using the two-value
`diffuse` syntax, aka backside illumination, like so:

    texture {
      ...
      finish {
        diffuse albedo 0.6, 0.3
      }
    }

(*Alternatively, you could also cut out a piece of surface from a solid
object, such as a sphere or cylinder, using `clipped_by`.)

This tells POV-Ray that from all the light shining onto the surface of
the object, 60% should be reflected in a lambertian manner, i.e.
independent of the incident light angle and with a cos-law distribution,
while another 30% should be emitted on the other side, also independent
of the incident light angle and with a cos-law distribution.


Of course real-life diffuser sheets aren't ideal, as transmitted light
/is/ dependent on incident light angle, so if you need to model the
material more precisely, in its current form the backside illumination
is probably of little use to you.


Post a reply to this message

From: IGM
Subject: Re: Realistic scattering
Date: 6 Apr 2018 13:30:00
Message: <web.5ac7ae12798d406981e21df40@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> You can model an ideal diffuser sheet using a patch primitive (such as a
> triangle, an open mesh or a bezier patch*), and using the two-value
> `diffuse` syntax, aka backside illumination, like so:

Is it possible also with simple objects like boxes? If not, why?

> This tells POV-Ray that from all the light shining onto the surface of
> the object, 60% should be reflected in a lambertian manner, i.e.
> independent of the incident light angle and with a cos-law distribution,
> while another 30% should be emitted on the other side, also independent
> of the incident light angle and with a cos-law distribution.

Are photons needed for this effect?

> Of course real-life diffuser sheets aren't ideal, as transmitted light
> /is/ dependent on incident light angle, so if you need to model the
> material more precisely, in its current form the backside illumination
> is probably of little use to you.

May "fresnel" keyword help?

Thank you!!
igmar


Post a reply to this message

From: Bald Eagle
Subject: Re: Realistic scattering
Date: 6 Apr 2018 13:55:05
Message: <web.5ac7b3f7798d4069c437ac910@news.povray.org>
"IGM" <iar### [at] gmailcom> wrote:

> Is it possible also with simple objects like boxes? If not, why?

Of course.
I was even thinking just use a simple thin box with a low transmit value.


> Are photons needed for this effect?

Nope.


> May "fresnel" keyword help?

As Alain astutely pointed out in a recent post - you need an interior{} block
with an ior value.  I think that would look cool as a translucent marble with
subsurface scattering  (nod)  :)


Post a reply to this message

From: clipka
Subject: Re: Realistic scattering
Date: 6 Apr 2018 15:49:33
Message: <5ac7cf4d$1@news.povray.org>
Am 06.04.2018 um 19:27 schrieb IGM:
> clipka <ano### [at] anonymousorg> wrote:
>> You can model an ideal diffuser sheet using a patch primitive (such as a
>> triangle, an open mesh or a bezier patch*), and using the two-value
>> `diffuse` syntax, aka backside illumination, like so:
> 
> Is it possible also with simple objects like boxes? If not, why?

You'll need an object comprised of just a single surface.(*) Because
when POV-Ray computes the surface colour at a given point, it can easily
compute how brightly that very point on the surface is directly
illuminated (this has been one of the most basic operations in POV-Ray's
algorithm for ages, even including a test whether the light comes from
the front or the back of that surface), but taking account light shining
on other locations of the object's surface is an entirely different
matter and far more complex.

(*Note however that this could be a /portion/ of a box, with the rest
cut away using `clipped_by`. Or you could do some fancy tricks with
interior_texture so that only one side appears to be diffuser-sheet-ish
while the other effectively becomes invisible.)

That said, you /may/ have some luck with subsurface light transport,
which is specifically designed to pick up light transported from other
points on the object's surface. However, it is designed for materials
where the scattering of the light happens in the bulk rather than at the
surfaces, and it also can only handle isotropic scattering at the moment.


>> This tells POV-Ray that from all the light shining onto the surface of
>> the object, 60% should be reflected in a lambertian manner, i.e.
>> independent of the incident light angle and with a cos-law distribution,
>> while another 30% should be emitted on the other side, also independent
>> of the incident light angle and with a cos-law distribution.
> 
> Are photons needed for this effect?

Nope. Just a light source, the single surface, and the two-parameter
`diffuse`.


>> Of course real-life diffuser sheets aren't ideal, as transmitted light
>> /is/ dependent on incident light angle, so if you need to model the
>> material more precisely, in its current form the backside illumination
>> is probably of little use to you.
> 
> May "fresnel" keyword help?

Presumably not; while it does indeed introduce both a dependency on the
incident light angle as well as a dependency on the outgoing light
angle, it does not introduce any dependency on the /relationship/
between the two angles, something that real-life diffuser sheets do
exhibit(*).

(* The primary reason for this is that while you want a diffuser sheet
to scatter light, you still want it to transmit as much of it as you can
get away with. For the outgoing light direction to be perfectly
independent from the incoming light direction would mean that the
outgoing light direction would also have no preference for either side
of the sheet, so you'd end up transmitting only 50% of the light, while
the other 50% would be spilled back to the illuminated side.)

What we'd really need to model real-life diffuser sheets would be a
mechanism that is similar to the diffuse backside illumination (as
modeled by the second `diffuse` parameter) in that it picks up light
from the other side of the surface, but mathematically more similar to
`specular` or `phong`.

It probably would be quite easy to implement, but I haven't come up with
a neat syntax yet. Two-parameter forms of "specular" or "phong" don't
quite cut it in my book.


Post a reply to this message

From: Alain
Subject: Re: Realistic scattering
Date: 6 Apr 2018 22:42:36
Message: <5ac8301c$1@news.povray.org>
Le 18-04-06 à 13:27, IGM a écrit :
> clipka <ano### [at] anonymousorg> wrote:
>> You can model an ideal diffuser sheet using a patch primitive (such as a
>> triangle, an open mesh or a bezier patch*), and using the two-value
>> `diffuse` syntax, aka backside illumination, like so:
> 
> Is it possible also with simple objects like boxes? If not, why?

Not directly.
It can work in a radiosity scene where the second surface can get 
illuminated by the backside illumination.
It takes MUCH longer to render. You may need to increase the back part 
so that both components add up to more than 1.

> 
>> This tells POV-Ray that from all the light shining onto the surface of
>> the object, 60% should be reflected in a lambertian manner, i.e.
>> independent of the incident light angle and with a cos-law distribution,
>> while another 30% should be emitted on the other side, also independent
>> of the incident light angle and with a cos-law distribution.
> 
> Are photons needed for this effect?
Not at all
> 
>> Of course real-life diffuser sheets aren't ideal, as transmitted light
>> /is/ dependent on incident light angle, so if you need to model the
>> material more precisely, in its current form the backside illumination
>> is probably of little use to you.
> 
> May "fresnel" keyword help?
> 
> Thank you!!
> igmar
> 
> 

fresnel is for specular reflection that obey the fresnel equation/law, 
where the reflection depend on the angle of incidence and difference of 
IORs between the outside and inside of the object.

One way that /may/ possibly work could be to abuse the brilliance 
parameter in a way that was not intended.
Setting a large brilliance value may affect the backside illumination in 
some way. Do your experiment as I never tried that trick.
The default for brilliance is 1.


Post a reply to this message

From: IGM
Subject: Re: Realistic scattering
Date: 10 Apr 2018 08:05:01
Message: <web.5acca7a7798d4069776fc67d0@news.povray.org>
I obtained a quite good result (for my needs), but I still cannot notice any
difference in using "albedo"...

Here is the code:

#version 3.7;
global_settings { assumed_gamma 1.0 }
#default{ finish { ambient 0.0 diffuse 0.0 } }

background {rgb 0.5*<1,1,1>}

// camera ------------------------------------------------------------------
  camera {angle 20    // natural view
  location  <0,0,0>
  right     x*image_width/image_height
  look_at   <0,0,1>
  translate <0,0,-250>}

//--------------------------------------------------------------------------
//---------------------------- objects in scene ----------------------------
//--------------------------------------------------------------------------

#declare diffusor = material {
  texture {
    pigment { rgbt <1,1,1, 0.08> }
    finish {
      ambient 0.4
      specular 0.0
      reflection { 0.0 }
      diffuse albedo 0.1,0.9
      crand 0.8
    }
  }
}

// Light source
sphere {<0,0,0> 1 pigment { rgb <1,1,1> } finish {emission 2} no_shadow }
light_source {
    <0,0,0>
    color 3000*<1,1,1>
    fade_distance 1
    fade_power 2
}

// Diffusor object
#declare box_size = 50;
box { <-box_size/2,-box_size/2,0>,<box_size/2,box_size/2,0.1> translate
<25,0,-20>   material { diffusor } }


Post a reply to this message

From: clipka
Subject: Re: Realistic scattering
Date: 10 Apr 2018 11:53:50
Message: <5accde0e$1@news.povray.org>
Am 10.04.2018 um 14:01 schrieb IGM:
> I obtained a quite good result (for my needs), but I still cannot notice any
> difference in using "albedo"...

`albedo` makes a difference when you set `brilliance` to anything other
than the default of 1.0.


Post a reply to this message

From: William F Pokorny
Subject: Re: Realistic scattering
Date: 10 Apr 2018 19:52:50
Message: <5acd4e52$1@news.povray.org>
On 04/10/2018 11:53 AM, clipka wrote:
> Am 10.04.2018 um 14:01 schrieb IGM:
>> I obtained a quite good result (for my needs), but I still cannot notice any
>> difference in using "albedo"...
> 
> `albedo` makes a difference when you set `brilliance` to anything other
> than the default of 1.0.
> 

This note exists in our documentation only where diffuse albedo is 
specified - and I missed it. I was too confused about little or no 
effect when I tried it. I'm remain foggy on the albedo workings.

- Does the "only works with brilliance != 1.0" not apply to phong and 
specular albedo too... Or does it and we don't mention it in our 
documentation?

- I've never used 'diffuse albedo' without 'phong albedo' or 'specular 
albedo' being specified too as I thought the point was to consider the 
contributions together and further that diffuse albedo would be 1.0 and 
phong albedo + specular albedo also = 1.0. I see in Igmar's code he has 
specular 0.0 so not having the albedo qualifier there likely no issue. 
If his specular value were to have been other than 1.0 what would 
happen? Might suppose the diffuse calculation would still consider the 
specular but would the specular calculation consider the diffuse albedo 
value?

- What happens in the reverse if someone specifies plain diffuse but 
phong/specular albedo values ?

- We have only two sample scenes using albedo. The first your torus2.pov 
and only in the default {} with brilliance unchanged. The other 
finish_fresnel.pov where the the diffuse/specular values match as I 
expect, but where brilliance is not specified. Should brilliance at 
other than 1.0 be added in that scene?

Aside: A sample scene showing an albedo set up versus not with visible 
differences would probably be a help.

Bill P.


Post a reply to this message

From: clipka
Subject: Re: Realistic scattering
Date: 11 Apr 2018 13:33:36
Message: <5ace46f0$1@news.povray.org>
Am 11.04.2018 um 01:52 schrieb William F Pokorny:

> This note exists in our documentation only where diffuse albedo is
> specified - and I missed it. I was too confused about little or no
> effect when I tried it. I'm remain foggy on the albedo workings.
> 
> - Does the "only works with brilliance != 1.0" not apply to phong and
> specular albedo too... Or does it and we don't mention it in our
> documentation?

With highlights, it's not `brilliance` but `roughness` and `phong_size`,
respectively. There, too, is some "sweet spot" for those settings where
albedo doesn't make a difference, but usually the settings are far away
from that.

The motivation of the`albedo` keyword is that traditionally, the
`diffuse` and specular settings effectively specify the /peak/
brightness of the effect; so e.g. when you specify `diffuse 0.2 specular
0.5`. it means that under nominal lighting conditions the brightest spot
of the highlight has a brightness of 0.7.

But for the sake of designing realistic materials, you don't need to
know the /peak/ reflectivity of a material, but the /total/
reflectivity; and as you increase the "spread" of the effect, you also
increase that total reflectivity if you leave the peak brightness unchanged.

The `albedo` keyword puts the effect in a mode where it compensates for
the "spread" parameter: if e.g. you specify `specular albedo 0.5`, it
means that 50% of all the incoming light is reflected back (specularly),
no matter what the `roughness` parameter is set to.


The `albedo`-style parameterization was primarily designed for the
highlight effects, to make it easy to get the brightness synced up with
the specular reflection as specified by the `reflection` settings,
because both model the same physical effect (albeit for light from
different sources, namely light sources vs. other objects), so for
realism it is quite important to get them lined up properly.

As for the `diffuse` keyword, the `brilliance` setting breaks realism
anyway, and for the only realistic setting there is no difference; but
`ambient`-style parameterization was added nonetheless, if only for
giggles and completeness.


> - I've never used 'diffuse albedo' without 'phong albedo' or 'specular
> albedo' being specified too as I thought the point was to consider the
> contributions together and further that diffuse albedo would be 1.0 and
> phong albedo + specular albedo also = 1.0. I see in Igmar's code he has
> specular 0.0 so not having the albedo qualifier there likely no issue.
> If his specular value were to have been other than 1.0 what would
> happen? Might suppose the diffuse calculation would still consider the
> specular but would the specular calculation consider the diffuse albedo
> value?
> 
> - What happens in the reverse if someone specifies plain diffuse but
> phong/specular albedo values ?

The `albedo` keyword only switches to another parameterization for that
particular feature; the other features remain unaffected.

For example, `diffuse albedo 0.2 specular albedo 0.5` means that 20% of
the incoming light is reflected diffusely, while 50% is reflected
specularly.


There's a caveat when `fresnel` is enabled: In that case, the refractive
index also affects the brightness of the diffuse and specular
components, but `albedo` does not compensate for this.


> - We have only two sample scenes using albedo. The first your torus2.pov
> and only in the default {} with brilliance unchanged. The other
> finish_fresnel.pov where the the diffuse/specular values match as I
> expect, but where brilliance is not specified. Should brilliance at
> other than 1.0 be added in that scene?

While the scenes /use/ albedo, none of them really /demonstrates/ it;
it's more or less just in there because I've made it a habit of always
using it.


> Aside: A sample scene showing an albedo set up versus not with visible
> differences would probably be a help.

That's a bit nonsensical in my view, because you can't tell from an
image whether `albedo` was used or not - it's just a different way to
parameterize the individual finish features, and you can get the exact
same results with the classic parameterization. The difference is in
ease of use, not effect: With the classic parameterization you have to
guess and toy around until you /think/(*) it's realistic (or wreck your
brain trying to compensate for the "spread" parameter manually), whereas
with the `albedo` setting you can tell just from the numbers whether the
material is reasonably realistic.

(*In general, with the classic setting people tend to make highlights
unrealistically dim, except for /very/ blurry highlights which people
tend to make unrealistically bright.)


What would make sense, I guess, would be a scene comparing two /series/
of objects with changes to the `roughness` setting, with constant
`specular` setting, one series using `albedo` and the other using the
classic parameterization, to demonstrate the compensating effect of
`albedo`.


Post a reply to this message

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