POV-Ray

The Persistence of Vision Raytracer (POV-Ray).

This is the legacy Bug Tracking System for the POV-Ray project. Bugs listed here are being migrated to our github issue tracker. Please refer to that for new reports or updates to existing ones on this system.

Attached to Project: POV-Ray
Opened by Corvin Zahn - 2010-09-23
Last edited by Christoph Lipka - 2012-06-21

FS#165 - photon problem: image of projected image_map is clipped at the corners

Hi,

I have a problem with photons. The following stripped down code simulates a
slide projector:


#include "colors.inc"
global_settings {
  #if (1)   // switch photons on/off
    photons { count 1000000 }
  #end
}
camera { location <0, 0, 200> sky<0,1,0> look_at <0,200,-200> angle 90 }
// projection screen
plane { z, -200 texture { pigment { White } finish{ diffuse 1 ambient 0.1} } }
// slide
polygon {
  5, <0,0,0>, <1,0,0>,<1,1,0>,<0,1,0>,<0,0,0>
  pigment { image_map {jpeg "s7_0.9_320.jpg" interpolate 2 filter all 1.0 } }
  translate <-0.5, 0.2, -0.3>
  photons { target refraction on reflection off collect off }
}
// projector lamp
light_source { <0, 0, 0>  color <1,1,1> }

——————————————-

A point light source projects through a image_map onto a screen.

Without photons the projected image is ok:
http://img838.imageshack.us/i/test4woph.png/

With photons the left and right bottom corners of the image will be clipped:
http://img101.imageshack.us/i/test4wph.png/

The size of clipped corners depends on the y-offset in the translate command.

The povray Version is:
Persistence of Vision™ Ray Tracer Version 3.6.1 (Debian (x86_64-linux-gnu-g+
+ 4.3.3 @ x86_64-pc-linux-gnu))
(the 3.7 beta has the same problem)

I posted this question in the general news group and got an answer by Christian Froeschlin,
who could reproduce the problem and suggested as workaround to divide the slide into small stripes

http://news.povray.org/povray.general/thread/%3Cweb.4c972bdffcc128eac947b6de0%40news.povray.org%3E/

This works, but doesn’t explain the problem.

Does anyone have an idea, whats wrong?

Many thanks,
Corvin

Closed by  Christoph Lipka
Thursday, 21 June 2012, 22:57 GMT
Reason for closing:  Fixed
Additional comments about closing:  

no news, so I guess the fix was effective

Grimbert Jérôme commented on Saturday, 21 May 2011, 17:13 GMT

I tried it with a 3840x1200 jpeg in 3.7RC3: not only the corners are gone (well, dark), but the image is went from "clear" to "out of focus" when adding photons.
(adding more photons provide more focus)

Could the corners be related to the angle of the photon shooter ?

Admin
Christoph Lipka commented on Sunday, 22 May 2011, 00:39 GMT

As for the out-of-focus effect, that's actually inevitable unless you shoot at least one photon per "slide" pixel (i.e. 4,608,000 photons in your test case); even then you'll still get sampling artifacts of one type or another due to the photons not hitting every pixel right in the center.

Grimbert Jérôme commented on Monday, 11 July 2011, 16:21 GMT
// slide
#if (0)
polygon {
  5, <0,0,0>, <1,0,0>,<1,1,0>,<0,1,0>,<0,0,0>
#else
		box { < -1,-1,0>/20*clock,<1,1,0>+<1,1,0>/20*clock 

(and "once" in the image_map)

The corners come back for a value of clock at 0.8 (but not for 0.75!)

Using <0,-1,0>/20*clock does not give such a good result (at all: at clock 1, corners are still missing)

Using < -1,0,0> (and < 1,0,0>) instead of < -1,-1,0> (and <1,1,0>) neither. The black corners extend beyond the image_map with once, so it seems irrelevant to image_map and more specifici to the photon code.

Grimbert Jérôme commented on Sunday, 14 August 2011, 20:07 GMT

I think I found something, in ShootingDirection::compute() (photons.cpp)

The code computes the radius of the bounding box, and then use the cone from the lighsource to the disc of same radius at the center of the bounding box.

Issue: the sphere at the center of the bounding is larger than the cone (part of the sphere is out of the cone). This comes especially stronger when the light source is inside the sphere!

This explains the round corner of shadow with the demo scene. (still that old story of apparent radius)

	/*
	light   dist         ctr
	* ------------------ +
	     ---___          |
	           ---___    | rad
	                 ---_|
	*/

It should be something like:

	/*
	light   dist         ctr
	* ------------------ +
	     ---___         /|
	           ---___  / | rad
	                 -/-_|
                             *
	*/
Grimbert Jérôme commented on Monday, 15 August 2011, 07:31 GMT

Corrected with #5470 for 3.7 line of release, as long as the lightsource is not inside the bounding sphere.
The radius computation performed by ShootingDirection::compute() in photons.cpp is adjusted as : rad /= sin(acos(rad/dist)); (as long as rad < dist)

The issue of rad >= dist (before the adjustement) would need a redesign to not use a shooting cone...

Admin
Christoph Lipka commented on Thursday, 25 August 2011, 12:09 GMT

change #5479 should address all remaining issues.

Grimbert Jérôme commented on Thursday, 25 August 2011, 12:37 GMT

Agreed, #5479 is far better and answers all considered issues.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing