POV-Ray : Newsgroups : povray.beta-test : Ambient and diffuse for include files? Server Time
17 Jan 2026 04:10:07 EST (-0500)
  Ambient and diffuse for include files? (Message 18 to 27 of 27)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: Ambient and diffuse for include files?
Date: 6 Jan 2026 12:30:00
Message: <web.695d468b485c224d44e64d2825979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> 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.

I were to interpret this,  I would say that after installing POV-Ray, we might
all agree to use Lucid_sans_unicode.ttf as our default font, and then the
default.inc file would run a check to see if that font existed, and if not, then
default to one of the inbuilt fonts.  Then default_font could be used as an
identifier in EVERY text {} object as the default, rather than specifying a
specific font filename.
Then if the default were changed, it could be done in that one place in the
default.inc file.


> 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 // Default_Ambient (no s)
>     diffuse Defaults_Diffuse // Default_Diffuse (no s)
>   }
> }
> global_settings { assumed_gamma Defaults_Gamma } // Default_Gamma (no s)
>
> #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.


The always-load would just declare those identifiers.
Any declarations in the scene would overwrite them.
What about Default_Ambient () as a macro, saving the typing of #declare, and it
could even call Default_Finish () to redeclare the default.
you could do the same with diffuse and gamma

> 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.

Well, there are comments,
but also, you could write a Version () macro that took two arguments, the
current version, and the intended version, and then you'd have a wide latitude
for what happens after that.

In fact, I'm thinking that a lot of the directives could be recast as
(capitalized) macros that do a lot of sanity checking and special handling.  As
a macro, we could internally document the use of the directive and guard against
any recurrent newbie (ab)uses.

It would be a great way to embed all of our accumulated knowledge into a
parallel system of commands that would be didactic/pedagogical,
self-documenting, and only a bit slower for most small, static scenes.

- BE


Post a reply to this message

From: jr
Subject: Re: Ambient and diffuse for include files?
Date: 6 Jan 2026 12:55:00
Message: <web.695d4c1d485c224d52af7e976cde94f1@news.povray.org>
hi,

Cousin Ricky <ric### [at] yahoocom> wrote:
> 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.

in context I mean(t):
#declare Defaults_Font = "timrom.ttf";

to allow use in those 'text{}'s.


> > [*] 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;

won't fly.  '#version' has to be first.


> ...
> 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.

in the 'defaults.inc' example that line comes before the guard, needed to avoid
an error.  the version required by the code (for includes) is inside the guard.
for scene files (I guess) there'd be no difference.


regards, jr.


Post a reply to this message

From: jr
Subject: Re: Ambient and diffuse for include files?
Date: 6 Jan 2026 13:10:00
Message: <web.695d4f35485c224d52af7e976cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> In fact, I'm thinking that a lot of the directives could be recast as
> (capitalized) macros that do a lot of sanity checking and special handling.  As
> a macro, we could internally document the use of the directive and guard against
> any recurrent newbie (ab)uses.
>
> It would be a great way to embed all of our accumulated knowledge into a
> parallel system of commands that would be didactic/pedagogical,
> self-documenting, and only a bit slower for most small, static scenes.

v nice idea.  "self-documenting" - exactly, I like that.


regards, jr.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Ambient and diffuse for include files?
Date: 6 Jan 2026 22:38:09
Message: <695dd521$1@news.povray.org>
On 2026-01-06 13:53 (-4), jr wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>> 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.
> 
> in context I mean(t):
> #declare Defaults_Font = "timrom.ttf";
> 
> to allow use in those 'text{}'s.

I dunno.  That seems superfluous to me.

>> ---%<-----%<-----%<-----%<---[BEGIN CODE]---%<-----%<-----%<-----%<---
>> #declare Default_Ambient = rgb 0.05;
> 
> won't fly.  '#version' has to be first.

Granted.  I should have started that scene file excerpt with '#version
3.8;'.


Post a reply to this message

From: Bald Eagle
Subject: Re: Ambient and diffuse for include files?
Date: 7 Jan 2026 12:50:00
Message: <web.695e9c77485c224d68a6daf225979125@news.povray.org>
I wrote out a generic implementation for an always-included set of files.

A few things not yet implemented due to not having the code readily available.

Just a proof-of-concept, I'm sure that some things might be best loaded from
other dedicated include files, (best would be inbuilt as source), though I'm
still trying to work out a good way to have a "monolithic include file" where
only the desired parts will actually be loaded/implemented.

I think that a calculation for minimum visible size/radius would be a good
addition, as would an always-face-the-camera macro.


Post a reply to this message


Attachments:
Download 'defaults_be.inc.txt' (6 KB)

From: jr
Subject: Re: Ambient and diffuse for include files?
Date: 8 Jan 2026 02:00:00
Message: <web.695f5548485c224d52af7e976cde94f1@news.povray.org>
hi,

Cousin Ricky <ric### [at] yahoocom> wrote:
> ...
> > #declare Defaults_Font = "timrom.ttf";
> ...
> I dunno.  That seems superfluous to me.

:-)


> >> ---%<-----%<-----%<-----%<---[BEGIN CODE]---%<-----%<-----%<-----%<---
> >> #declare Default_Ambient = rgb 0.05;
> >
> > won't fly.  '#version' has to be first.
>
> Granted.  I should have started that scene file excerpt with '#version
> 3.8;'.

right, I used '#version version' as per "recommendation", see last sentence(s)
on the page:
<https://wiki.povray.org/content/Reference:Numeric_Expressions#Built-in_Variables>


regards, jr.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Ambient and diffuse for include files?
Date: 9 Jan 2026 20:40:09
Message: <6961adf9@news.povray.org>
On 2026-01-08 02:57 (-4), jr wrote:
> 
> right, I used '#version version' as per "recommendation", see last sentence(s)
> on the page:
> <https://wiki.povray.org/content/Reference:Numeric_Expressions#Built-in_Variables>

I read that paragraph a long time ago, and it didn't make sense to me.
Now I'm reading it over and over, and I still can't figure out what it
means, or why I should use that construct.


Post a reply to this message

From: Bald Eagle
Subject: Re: Ambient and diffuse for include files?
Date: 9 Jan 2026 21:15:00
Message: <web.6961b4f9485c224d1f9dae3025979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2026-01-08 02:57 (-4), jr wrote:
> >
> > right, I used '#version version' as per "recommendation", see last sentence(s)
> > on the page:
> > <https://wiki.povray.org/content/Reference:Numeric_Expressions#Built-in_Variables>
>
> I read that paragraph a long time ago, and it didn't make sense to me.
> Now I'm reading it over and over, and I still can't figure out what it
> means, or why I should use that construct.

I will agree that that paragraph is poorly phrased.
It may even have typos.

In any event, I think that the general idea is to just be able to declare the
version to be whatever software version is used. (automatically)
You can get rid of the warning/error using boilerplate and without having to
know what version is being used.

Then you can do whatever manual versioning stuff afterwards.

At least that seems to be the intent. (?)

- BE


Post a reply to this message

From: jr
Subject: Re: Ambient and diffuse for include files?
Date: 10 Jan 2026 02:35:00
Message: <web.69620050485c224d52af7e976cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
> > On 2026-01-08 02:57 (-4), jr wrote:
> > > right, I used '#version version' as per "recommendation", ...
> > I read that paragraph a long time ago, and it didn't make sense to me.
> > Now I'm reading it over and over, and I still can't figure out what it
> > means, or why I should use that construct.
>
> I will agree that that paragraph is poorly phrased.
> It may even have typos.

in which case, would (either of) you mind sending (or posting) a suggestion for
a re-worded, improved paragraph ?


> In any event, I think that the general idea is to just be able to declare the
> version to be whatever software version is used. (automatically)
> You can get rid of the warning/error using boilerplate and without having to
> know what version is being used.
> Then you can do whatever manual versioning stuff afterwards.
> At least that seems to be the intent. (?)


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Ambient and diffuse for include files?
Date: 13 Jan 2026 08:10:00
Message: <web.69664357485c224d438b893125979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> I read that paragraph a long time ago, and it didn't make sense to me.
> Now I'm reading it over and over, and I still can't figure out what it
> means, or why I should use that construct.

Best I can do on short notice.

I am aware that it's not entirely correct, however it's a step forward to
unraveling what actually occurs, so that we can properly, clearly, and
unambiguously summarize the behaviour of the version keyword(s).


See comments by clipka at:
https://github.com/POV-Ray/povray/issues/414

https://wiki.povray.org/content/Reference:Numeric_Expressions#Built-in_Variables
The built-in float variable version contains the current setting of the version
compatibility option.

.....

Note: As of POV-Ray v3.7, the version compatibility option defaults to 3.62
(corresponding to v3.6.2) rather than the actual software version.

However, in POV-Ray v3.7.0, version defaults to the actual software version.

This is a Change in POV-Ray v3.8 so that version generally reflects the version
compatibility option even in the default case, except when used inside the very
first #version statement where it still defaults to the actual software version.

Therefore, to identify POV-Ray version 3.8 or higher, you will need to start
your scene file with the following construct:

#version version;

-------------------------------------------------------------------------------------------

Copilot

omitted and when explicitly set via #version version;:

Default Behavior When #version Is Omitted

Up to POV-Ray 3.1: Defaults to 3.1 [www-f9.ijs.si]

[povray.org]
POV-Ray 3.7: Defaults to 3.62 (a legacy-compatible default), and a warning is
issued if no #version appears before other declarations [wiki.povray.org]
POV-Ray 3.8 and beyond: If neither #version, INI (Version=n.n), nor CLI switch

3.62 for compatibility [wiki.povray.org], [github.com]


Behavior When #version X.Y; Is Specified

Sets the language feature set to that version, enabling or disabling features
accordingly ─ e.g. #version 1.0 disables float expressions and newer
syntax [povray.org], [wiki.povray.org]
The trailing semicolon is mandatory (since v3.1); omitting it causes warnings
and can break macros [povray.org], [www-f9.ijs.si]
Setting #version multiple times during parsing switches compatibility modes and
can be used alongside #local and the version built-in:


1.0‑mode code#version Temp_Vers;         // Restore previous version```
[2](https://www.povray.org/documentation/view/3.6.0/240/)[3](https://wiki.povray.org/content/Reference:Version_Directiv
e)
 Show more lines

From POV-Ray 3.7 onward, explicitly specifying #version 3.7; (or higher) is
required to get full access to the latest syntax and defaults; otherwise,
old-style legacy defaults persist. [wiki.povray.org]


Summary Table

POV-Ray Version Range  Default if Omitted  #version X.Y; Effect


3.7    3.62 (warning if omitted) Required to access 3.7+ behavior; else legacy
defaults used

defaults for specified version


Key Takeaways

Omitting #version defaults to legacy-compatibility version (3.5 pre‑3.7,
3.62 from 3.7 onward).
Explicit #version X.Y; sets feature availability to that version (and is
required in modern POV-Ray to opt into newer syntax).
The version built-in and re-assignment via #version version; allow preserving
and restoring compatibility states during inclusion or scene control.




- BE


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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