POV-Ray : Newsgroups : povray.binaries.images : antialiasing fails with very bright objects : Re: antialiasing fails with very bright objects Server Time
2 May 2024 10:04:33 EDT (-0400)
  Re: antialiasing fails with very bright objects  
From: Bald Eagle
Date: 24 Feb 2021 20:50:01
Message: <web.603701491995ddaf1f9dae300@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> > Hmmm. I thought POV-Ray could write color values to a file that were over 1.
>
> As far as *I* know (which isn't saying a lot), typical LDR image files like JPEG
> and PNG top out at 255/255. Which makes sense, as to their final presentation on
> a typical monitor.
>
> > > But trying to determine which pixels are too bright *while* rendering
> > > involves POV-ray's inner workings; as William alluded to, the scene's
> > > pixel values (*prior* to being written to a file or to the preview screen)
> > > can easily exceed 1.0... hence the 'failed AA' effect, for example. I guess
> > > that they are clipped to that maximum only when the file is written, or
> > > when the preview can't reproduce them as-is.

Yes - this was bouncing around in my head today, in the insufficiently
caffeinated fog of fatigue, and I think you'd have to define a special
antialiasing mode to use something like my functions in the antialiasing
convolution matrix.
http://cs.trinity.edu/~jhowland/class.files.cs357.html/pov-new/Docs/pov155.htm

I quickly skimmed over some aa/convolution websites, and using a 7x7 matrix with
jittering seemed to give very nice results.

> BTW, I noticed something about my image results that makes me wonder about how
> the max(...) function operates on other *functions*...
>
> #declare OverOne = function{max(f_red (x,y,z), f_grn (x,y,z), f_blu (x,y,z))}
>
> It seems that if every entry in max(...) is actually EQUAL, the overall function
> returns all THREE values (combined? added?), not just one. I'm out of my depth
> here, though; maybe that's how max always treats equal values(?), even if
> they're just floats. But that's not a problem with the *code's* use; it works as
> planned.
>
> I've attached an image to illustrate this.

Yes.  Because OverOne is a function that acts more like a flag - because you
wanted to look at pixels with ANY component of the rgb color vector over one.

I have a mantra that I repeat to myself: "FUNCTIONS RETURN SCALAR VALUES".

So max returns the maximum value of all the arguments it is given.
1 is 1 is 1 is 1 is 1.
Or as Ayn Rand would admonish, "A is A."

So, if ANY one of the three components triggers the "bright pixel switch", the
value of its component function returns 1.  So OverOne acts as a sort of Boolean
indicator to show which pixels have at least one_component satisfying your
criteria.

So interpreting your visual results logically,
Are there pixels in the red channel that are > M?  Yes.
Are there pixels in the grn channel that are > M?  Yes.
Are there pixels in the blu channel that are > M?  Yes.

Which of those pixels meet your criteria?  ALL of them.

So OverOne shows ALL of those channels.  Because they way you wrote your inquiry
was to detect those brighter pixels.  And AFAIK, POV-Ray's aa mechanism doesn't
function through individual color channels, it just interpolates the whole rgb
color vector.


Post a reply to this message

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