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:45 EST (-0500)
  Re: Ambient and diffuse for include files?  
From: Bald Eagle
Date: 6 Jan 2026 09:25:00
Message: <web.695d1aef485c224d44e64d2825979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> I can post my ideas and preferences if you like - either here or in a separate
> thread so you can ponder their value.

Let's just go with "sure, Bill, you do that."  ;)

Here's my saved preferences for having AI write SDL.
These are for clarity, ease of reading, to facilitate any future debugging, and
also as a pseudo-typing notation in case we go that route with 4.0
Some of it is obvious to us, but needed to be specified because AI seems to mix
& match SDL and c++ syntax and structures.



General Syntax & Formatting

Use tabs for indentation.
Directives (#if, #for, #declare) should be on their own lines.
Internal lines of macros, loops, and CSG should be indented with tabs.
Arguments and vector components separated with leading spaces.
Decimal values should have leading zeros (e.g., 0.5 instead of .5).
Spaces around operators (+, -, *, =, , >).
Extra space after directives before parentheses, no inner padding inside () or
<>.
Fixed decimal places across a block.
Leading space before positive numbers for sign alignment.
Compact formatting: space after keywords before {, no space after {.
End every code block with // ***end of code***.
Avoid lowercase identifiers (reserved keywords); prefix identifiers by type:

S_ for scalar
V_ for vector
A1D_ for 1D array
A2D_ for 2D array


Control Structures

Prefer #for loops over #while.
Loop bounds should reflect 0-based arrays: #for (i, 0, ArraySize-1).
Use #if (A = B) instead of #if (A == B).
Avoid ternary for text values; use #if/#else/#end instead.
When ternary is allowed, enclose in parentheses: (A ? B : C).


Math & Functions

Use mod(A, B) instead of % or frac.
Use bitwise_or(A, B) instead of A | B.
Use * for multiplication.
Functions must be strictly mathematical (no multiline logic, no
#declare/#local).
Function argument names must be unique and prefixed with FnPar_.
Avoid dot operators in functions; predeclare components if needed.
Use select() instead of ternary in VM functions.
Vector math: use vcross, vdot, vlength in macros only (not in functions).


Scene & Object Rules

Camera positioned on -z axis looking toward +z.
Use left-handed coordinate system: x → right, y → up, z →
forward.
Use rgb instead of deprecated color.
Prefer specular highlights over phong.
Transforms must output transform{...} wrapper.
Include transforms.inc before using vtransform().
Avoid wrapping multi-object macros in object{}; use union{} for single-object
wrapping.
Pigment syntax: pigment {object {ObjectName rgb rgb}} (omit comma).
Pigment functions: function {PigmentName} without arguments.


Data Structures

Empty array syntax: #declare Array = array; (not array[0]).
Use proper spline/function pattern:

#declare SPL = spline{...};
#declare F_SPL = function{SPL}.



arguments.


Macros

Identifiers assigned inside macros must use #local.
Do not #declare then #local the same identifier.
Macros should not take a named output parameter; return expression and assign
externally.
Separate arguments for macros, loops, and calls.


- BE


Post a reply to this message

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