POV-Ray : Newsgroups : povray.beta-test : Ambient and diffuse for include files? : Re: Ambient and diffuse for include files? Server Time
9 Jan 2026 14:12:46 EST (-0500)
  Re: Ambient and diffuse for include files?  
From: Cousin Ricky
Date: 6 Jan 2026 10:13:52
Message: <695d26b0$1@news.povray.org>
On 2025-12-25 05:58 (-4), jr wrote:
> 
> unsure if it is "in the spirit", but a "dedicated" font (preferred TTF) default,
> for "post installation" ?

I don't know what you mean by "dedicated."  In current text{} syntax, a
font is always specified, so there is no default font.

> given the name and the purpose[*] of the file, I tried using 'include_header' to
> load it.  it seems that for the system-wide 'povray.ini' that keyword won't
> work.  for my personal file (~/.povray/3.8.povray.ini) I needed to add a
> '#version version;' line to 'defaults.inc', before the guard, to avoid the 'as
> of version 3.7' error message.
> 
> [*] I am looking at it not as the first include in other include files but as an
> "always load", ideally.

I was thinking of this sort of construction in the scene description file:

---%<-----%<-----%<-----%<---[BEGIN CODE]---%<-----%<-----%<-----%<---
#declare Default_Ambient = rgb 0.05;
#declare Default_Diffuse = 0.8;
#declare Default_Gamma = 1.8; // I wouldn't, but some might ;)

#default
{ finish
  { ambient Defaults_Ambient
    diffuse Defaults_Diffuse
  }
}
global_settings { assumed_gamma Defaults_Gamma }

#include "textures.inc"
#include "metals.inc"
#include "golds.inc"
#include "androidrobot.inc"
--->%----->%----->%----->%----[END CODE]---->%----->%----->%----->%---

This would work with or without an "always load"; the other include
files could just test for the identifiers in default.inc, and if they're
not defined, the include file could just assume the POV-Ray defaults.

But I had the thought that those #default and assumed_gamma statements
look kinda redundant.  It would be cleaner if those statements were
incorporated into defaults.inc; but with that scheme, an "always load"
wouldn't work, because the scene file would not have the chance to
#declare the default identifiers in advance.

As for '#version version;', the fundamental problem I have with this
construct is that it leaves no indication which version of POV-Ray the
scene file or include file is intended for.


Post a reply to this message

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