POV-Ray : Newsgroups : povray.pov4.discussion.general : Feature Adjustments: Area lights and Jittered Reflection/Refraction Server Time
16 Apr 2024 17:26:35 EDT (-0400)
  Feature Adjustments: Area lights and Jittered Reflection/Refraction (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: John VanSickle
Subject: Re: Feature Adjustments: Area lights and Jittered Reflection/Refraction
Date: 24 Mar 2010 20:57:58
Message: <4baab516$1@news.povray.org>
clipka wrote:

> The idea behind this is that it is no good to shoot e.g. approx. 4 
> prinary ray for each pixel (for AA), but 4x10 = 40 secondary rays for 
> first blurred reflection, 4x10x10 = 400 tertiary rays for second blurred 
> reflection, and maybe another 4x10x10x10 = 4000 shadow test rays for 
> area lights, when you could instead shoot e.g. 20 primary rays, 20x2 = 
> 40 secondary rays, 20x2x2 = 80 tertiary rays, and 20x2x2x2 = 160 shadow 
> test rays.

Pixar's docs indicate that shooting one reflected ray and/or one 
refracted ray for each intersection that has reflection and/or 
refraction in the shader, and one shadow ray for each intersection for 
each light source, is enough; anti-aliasing is accomplished by jittering 
the light sources and the reflected and refracted rays, and setting the 
overall anti-aliasing level high enough to reduce granularity to an 
acceptable level.

Regards,
John


Post a reply to this message

From: Warp
Subject: Re: Feature Adjustments: Area lights and Jittered Reflection/Refraction
Date: 25 Mar 2010 03:40:17
Message: <4bab1361@news.povray.org>
John VanSickle <evi### [at] hotmailcom> wrote:
> Pixar's docs indicate that shooting one reflected ray and/or one 
> refracted ray for each intersection that has reflection and/or 
> refraction in the shader, and one shadow ray for each intersection for 
> each light source, is enough; anti-aliasing is accomplished by jittering 
> the light sources and the reflected and refracted rays, and setting the 
> overall anti-aliasing level high enough to reduce granularity to an 
> acceptable level.

  In order to get a grain-free smooth result, you would have to shoot
something like 50 rays per pixel or more (depending on the scene and the
amount of blurriness). Think about how long it takes for a scene to render
with that much antialiasing.

  Just sending all the reflected rays at once, however, can be much faster
in simple cases because it's done only for the reflecting surface. For example,
this image took just a few minutes to render:

  http://warp.povusers.org/pics/Rubiks_Revenge2.jpg

-- 
                                                          - Warp


Post a reply to this message

From: John VanSickle
Subject: Re: Feature Adjustments: Area lights and Jittered Reflection/Refraction
Date: 25 Mar 2010 07:56:29
Message: <4bab4f6d$1@news.povray.org>
Warp wrote:
> John VanSickle <evi### [at] hotmailcom> wrote:
>> Pixar's docs indicate that shooting one reflected ray and/or one 
>> refracted ray for each intersection that has reflection and/or 
>> refraction in the shader, and one shadow ray for each intersection for 
>> each light source, is enough; anti-aliasing is accomplished by jittering 
>> the light sources and the reflected and refracted rays, and setting the 
>> overall anti-aliasing level high enough to reduce granularity to an 
>> acceptable level.
> 
>   In order to get a grain-free smooth result, you would have to shoot
> something like 50 rays per pixel or more (depending on the scene and the
> amount of blurriness). Think about how long it takes for a scene to render
> with that much antialiasing.

The Pixar doc I'm referencing says that they usually need to sample from 
16 to 64 times for each pixel.

The doc is here:

   http://graphics.pixar.com/library/DistributedRayTracing/paper.pdf

Additionally, their method also includes adjusting the rays shot for 
motion blur and focal blur, and it turns out that the overall AA level 
needed is simply the maximum required by any of the effects in play, so 
that the total cost is no greater than that of the most expensive effect.

>   Just sending all the reflected rays at once, however, can be much faster
> in simple cases because it's done only for the reflecting surface. For example,
> this image took just a few minutes to render:
> 
>   http://warp.povusers.org/pics/Rubiks_Revenge2.jpg

Perhaps this can also be handled (and really, should be handled) by 
allowing the user to specify higher AA levels for certain areas of the 
screen that are believed to require it.  If one object has a great deal 
of fine detail, the user should be able to specify a high AA level for 
the pixels that cover it, without forcing the whole frame to be sampled 
at that high level.

It should be simple enough for a user (let's say in POV-Ray) to specify

aa_box {
   <-1,4,2>,<0,5,3>
   aa_level 5
}

and the renderer, prior to rendering scene objects, would mark the frame 
buffer so that the pixels covered by this box get sampled at an AA level 
of five instead of for the overall scene level.  If two such boxes with 
differing AA levels overlap, the overlap area is sampled at the higher 
of the two rates.

Regards,
John


Post a reply to this message

From: Warp
Subject: Re: Feature Adjustments: Area lights and Jittered Reflection/Refraction
Date: 25 Mar 2010 09:13:27
Message: <4bab6177@news.povray.org>
John VanSickle <evi### [at] hotmailcom> wrote:
> >   Just sending all the reflected rays at once, however, can be much faster
> > in simple cases because it's done only for the reflecting surface. For example,
> > this image took just a few minutes to render:
> > 
> >   http://warp.povusers.org/pics/Rubiks_Revenge2.jpg

> Perhaps this can also be handled (and really, should be handled) by 
> allowing the user to specify higher AA levels for certain areas of the 
> screen that are believed to require it.  If one object has a great deal 
> of fine detail, the user should be able to specify a high AA level for 
> the pixels that cover it, without forcing the whole frame to be sampled 
> at that high level.

  It would still be slower because the amount of rays would be doubled.

  If, for example, in the above image something like 30 rays were spawned
for each reflected ray, it means that the total amount of rays traced to
for one camera sample would be 31 rays (the ray sent from the camera plus
the 30 reflected rays sent from the surface).

  However, if there was a mechanism to say "if a ray hits this surface,
perform antialiasing in such a way that 30 reflected rays will be produced",
it would mean that 30 sample rays, instead of 1, would have to be traced
from the camera towards the surface, and for each, a reflected ray would
have been traced, making the total amount of traced rays 60 (30 rays sent
from the camera, plus 30 reflected rays), almost double than above.

  Not that being able to specify antialiasing settings on a per-object basis
is a bad idea. It's just not necessarily the most efficient way of calculating
blurred reflections in all cases.

-- 
                                                          - Warp


Post a reply to this message

From: MessyBlob
Subject: Re: Feature Adjustments: Area lights and Jittered Reflection/Refraction
Date: 19 Nov 2010 21:05:00
Message: <web.4ce72ba97d905778addfbead0@news.povray.org>
"scott" <sco### [at] scottcom> wrote:
> MCPov allows you to do exactly that, using a simple "mc_reflect" keyword in
> the finish block.  It takes parameters for the number of rays to spawn and
> the "burriness" of the reflection:

Neat!
I usually resort to micro-normals. This method gives a high degree of control,
but results are not perfect: it's computationally expensive to smooth out the
roughness, and surfaces always appear 'bitty' with adaptive anti-aliasing, the
only workaround being to force more rays with focal blur, or to render a larger
image size than is finally needed, then re-sample down.

When thinking about prospective extensions to POV-Ray, I always think "How would
this 'exception branching' affect the speed of the core renderer for all the
other functions?"  The decision of whether to implement a specific feature has
to rely on the answer to the questions:
a) "Will scene rendering time improve for most users for most scenes?" and
b) "Will the quality of the render be better than it can currently be?"

If the answer to both is "yes", then there's a fairly good case for inclusion.

As an extension to the above questions, I also wonder how fast a stripped-down
POV-Ray would be, if all the conditional branches (that are not relevant to a
scene) are removed from the code. The natural end-point of this line of thought
it 'JIT compilation', which would allow more 'specialisations' to be included
without affecting generic performance - and this is where the seemingly opposed
approaches (generic outsourcing to implicit shaders, and optimising for
specialised needs) need not be opposed! :o)

p.s. I speak as if I have contributed to POV-Ray code; I haven't. This is just
my 'developer brain' applying to POV-Ray.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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