POV-Ray : Newsgroups : povray.beta-test : Experimental alternative diffuse models : Experimental alternative diffuse models Server Time
26 Apr 2024 11:40:39 EDT (-0400)
  Experimental alternative diffuse models  
From: clipka
Date: 31 Mar 2016 13:27:57
Message: <56fd5e1d@news.povray.org>
I've just released an experimental version of POV-Ray implementing two
alternative models for diffuse reflection, besides the classic so-called
Lambertian model:

https://github.com/POV-Ray/povray/releases/tag/v3.7.1-alpha.8545805%2Bav122

I'd like to invite you to toy around with them as you deem fit.


To explain what these alternative models do, let me first bore you to
death with some background information:


In a totally strict sense, diffuse reflection is the effect that light
hitting a surface bounces off in a direction that is entirely
independent of the angle of incidence. There is essentially just one
manner in which this can happen, and it is perfectly described by the
so-called Lambertian model, which is what POV-Ray uses.

Surprisingly enough, for this type of reflection to happen, the object's
surface must be _perfectly smooth_; all of what we might call
"diffuseness" must be from scattering within the material itself -- the
same process we now know as "subsurface scattering". So the Lambertian
model can be thought of as a subsurface scattering model, suitable for
materials in which the light doesn't travel far before exiting again (in
technical terms, materials with a very low "mean free path" between
scattering events).

As soon as the surface exhibits any kind of roughness, other effects
kick in that mess with the neat non-directionality of the Lambertian
model; for instance, in a bumpy surface, portions of the surface which
are angled towards the light source will receive more incoming light;
since each portion of the surface will emit light preferentially in the
direction of its surface normal, this will bias the outgoing light
towards the direction of incoming light.


The alternative models try to account for such effects in different ways:


- The Oren-Nayar model is based on the presumption that the surface is
comprised of microscopic facets of somewhat random orientation that form
V-shaped pits, with each individual facet exhibiting Lambertian
reflection. The model takes into account not only microfacet
orientation, but also shadowing and masking of light by the opposite
side of each pit, as well as interreflection between the sides. For the
sake of computational simplicity, instead of the full model I've
implemented the more commonly used simplified version, known as the
"qualitative model", which eliminates one term that contributes only
little to the result, and uses a very rough approximation for
interreflection.

To use the (qualitative) Oren-Nayar model, specify:

    finish {
      diffuse FLOAT
      oren_nayar ROUGHNESS
    }

where the ROUGHNESS parameter is a metric for the roughness of the
material. (Currently this is the _sigma_ parameter in the Oren-Nayar
equations; however, please be aware that this may still be subject to
change without notice.)

The Lambertian model can be considered a special case of the Oren-Nayar
model, with ROUGHNESS = 0.0.


- The Lommel-Seeliger model has its roots in astronomy, where it is used
to model "lunar type" (i.e. rocky or dusty) surfaces, while the
Lambertian model is used for "icy" surfaces, and weighted averages of
the two are used to model anything in between.

To use the Lommel-Seeliger model, specify:

    finish {
      diffuse FLOAT
      lommel_seeliger K
    }

where K specifies the weight of the Lommel-Seeliger model, ranging from
0.0 (pure Lambertian) to 1.0 (pure Lommel-Seeliger)


Have fun, and feel free to go crazy testing!


Post a reply to this message

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