POV-Ray : Newsgroups : povray.advanced-users : Photons, in version 3.6 to 3.7 : Re: Photons, in version 3.6 to 3.7 Server Time
18 Apr 2024 09:06:52 EDT (-0400)
  Re: Photons, in version 3.6 to 3.7  
From: William F Pokorny
Date: 9 May 2019 14:51:12
Message: <5cd476a0$1@news.povray.org>
On 5/9/19 10:36 AM, Albun wrote:
> 
> 
> For the moved light, and any other set up, it's another beautyful aspect.
> But i stay right in my boots for that ....;-)))
> 
> For the code, i havent an idea about what happen with the source.
> But i understand that is not easy to really know all
> thing happen in the 'troubling unknowquantic rendering',
> if i can naming it like that.
> 
> Albun
> 

OK. The actual issue is in the PhotonTrace::TraceRay code in photons.cpp 
where we have:

     found = FindIntersection(bestisect, ray, precond, postcond);
     if(found)
     {...

this borrows 'NoSomethingFlagRayObjectCondition precond' from trace.cpp 
which starts off with:

bool NoSomethingFlagRayObjectCondition::operator()(const Ray& ray, 
ConstObjectPtr object, double) const
{
     if(ray.IsImageRay() && Test_Flag(object, NO_IMAGE_FLAG))
         return false;

which returns false because of how ray.IsImageRay() is set up. We can 
hard code around the issue by changing:

     found = FindIntersection(bestisect, ray, precond, postcond);

to

     found = FindIntersection(bestisect, ray);

but I think the right thing to do is probably to change the 
ray.IsImageRay() definition in ray.h from:

  bool IsImageRay() const { return primaryRay || (refractionRay && 
!reflectionRay && !radiosityRay); }

to:

bool IsImageRay() const { return (primaryRay && !photonRay) || 
(refractionRay && !reflectionRay && !photonRay && !radiosityRay); }

or suppose some photon code specific precond a possibility too. My guess 
at the moment is that this 3.6 to 3.7 change was not intentional.

Christoph?

Bill P.


Post a reply to this message

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