POV-Ray : Newsgroups : povray.beta-test : Ambient and diffuse for include files? : Ambient and diffuse for include files? Server Time
1 Jul 2022 19:51:36 EDT (-0400)
  Ambient and diffuse for include files?  
From: Cousin Ricky
Date: 7 Mar 2022 13:33:29
Message: <62264ff9$1@news.povray.org>
There are gaps in SDL's ability to query the state of the render, and
one of these is the default finish.  This is a problem for defining
certain library textures when radiosity is not used, as include files
have no access to the scene's lighting conditions.  This is the case
with several of the standard include files.

For a 100% diffuse texture, this is easily solved by omitting an ambient
from the finish, and setting a default ambient prior to including the
file that defines the texture; the textures in woods.inc are like this.
At the other extreme, a 100% specular texture, such as a pure metallic
texture, would have both ambient and diffuse set to zero.

But what about a texture that is, say, half metallic?  In that case, the
diffuse and ambient need to be halved.  But halved from what?  While it
is possible to override a finish ambient, I feel it is an unreasonable
burden on the user to have them figure out what ambient is appropriate
for each library texture.

The solution I used for RC3Metal was to have the user declare variables
with the scene's default ambient and diffuse.  But to implement this
solution over many include files would cumbersome for the user.  These
standard include files all set non-zero ambients on declared textures:
  glass_old.inc
  golds.inc
  metals.inc
  stones1.inc
  stones2.inc
  textures.inc

(Files finish.inc, skies.inc, and stars.inc also set non-zero ambients,
but these should really be converted to emission.)

One way to solve this would be to declare a single pair of variables
that would be used by all six include files.  Third party include files
would be encouraged to access these variables.  What do you think of
this proposal?  Does anyone have a better idea?


Post a reply to this message

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