POV-Ray : Newsgroups : povray.general : no_image behaviour : Re: no_image behaviour Server Time
5 May 2024 15:18:50 EDT (-0400)
  Re: no_image behaviour  
From: William F Pokorny
Date: 21 Jun 2018 08:49:47
Message: <5b2b9eeb$1@news.povray.org>
On 06/21/2018 04:48 AM, jr wrote:
> hi,
> 
> William F Pokorny <ano### [at] anonymousorg> wrote:
>> The latest 'Pre_release' has been good to me.
>> https://github.com/POV-Ray/povray/releases/tag/v3.8.0-alpha.9606898
> 
> thanks.  after installing I tried your code, and yes, you were correct, the
> scene demonstrates the exact effect I'm after.
> 
> so I printed out the code for closer examination.  it must have taken me 20 mins
> or so before I saw where the colours are coming from (the trailing commas in
> user_defined{} did that  :-)), and perhaps as long again to understand why the
> enclosing sphere doesn't display in white.
> 
> I thought I now have a handle on this - until I changed the green component of
> the user_defined from multiply to add.  :-)  and now I have more questions..
> 
> so, I do not understand why the multiplication and addition differ.  I get the
> changed colours, but not why the part of the hidden sphere which does not
> intersect the reveal box only shows when added or why it doesn't when
> multiplied.

The object pattern returns 0 or 1. Where we have the reveal box for the 
red channel, the density value is always 1.0 and we always see that box.

To reveal the hidden sphere only where the reveal box exists we're using 
the green channel and multiplication. Only where we have 1(reveal 
box)*1(hidden sphere) in the green channel does it turn on (=1) and red 
and green now mix to get yellow for box samples within the hidden 
sphere. Outside the reveal box where have 0(reveal box)*1(hidden sphere) 
or 0 for density.

When you use addition instead for the green channel of the reveal box is 
also on inside the box (as already was red) and you get yellow for the 
box alone. The sphere is 1 where points are inside so you get green for 
the parts which are outside the reveal box. Inside the reveal box you 
get 1+1 green channel density and a more intense yellow green where they 
mix.

> 
> another question regards the actual density of box and hidden sphere.  their
> densities decrease away from the centres because functions are used, I presume.
> how would one get an uniformly dense box and/or sphere?  is a DF3 needed?
> 

The densities in the original implementation are 1 or 0 inside the 
reveal box. The apparent density decrease you see is due the differences 
in path length through the constant the density. In other words each 
ray's travel time through the density is different. When using emissive 
media this means the longer travel distances end up brighter. You can 
normalize to degrees in various ways, but up front I'd suggest adding 
absorbing media also at 1/white to start. As rays travel further the 
more absorption you get.

> and, last question, is there a particular reason that the media colour is rgb
> while all other colours are sRGB?
> 

The media spec could be srgb so long as you understand the resulting 
internal linear rgb values, but with densities and media it's much 
easier to work and think in linear, 'assumed_gamma 1.0' space.

> thank you again for the code (and your time), I feel I'm learning.

Happy to help - it's an interesting challenge.

> 
> regards, jr.
> 

Aside: In the code the overall media container encloses the reveal and 
hidden shapes. In an actual implementation you likely want your reveal 
object to also be your media container for performance reasons.

Bill P.


Post a reply to this message

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