POV-Ray : Newsgroups : povray.programming : Photons, radiosity ? : Re: Photons, radiosity ? Server Time
6 Oct 2024 14:01:03 EDT (-0400)
  Re: Photons, radiosity ?  
From: Rafal 'Raf256' Maj
Date: 21 Nov 2002 16:06:36
Message: <Xns92CDE0555DD5Araf256com@204.213.191.226>
"Thorsten Froehlich" <tho### [at] trfde> wrote in
news:3ddd4070$1@news.povray.org 

>> there are 2 photons, and bin-tree (in 3d - octall-tree) stors them in
> How did you guess this?  Surely not from the source code...

This technique is used in most 3d Engines (i.e. in Quake-2)

> Photons are stored in a kd-tree and radiosity data is stored in an
> oct-tree. 

What's the difference beetwen them ? In shortcut, if You can explain 
please.
 
>>    root
>>     / \
>>   1-4  5-8(no)
>>  /   \
>> 1-2  2-3(no)
>> / \
>> *  *
> Unless this is an extremly simplified example, this looks very much
> like a binary tree to me.  Both, kd-trees and oct-trees, are fairly
> advanced data structures compared to simple binary trees.

I was quesing that for 1d surfaces we use bin-tress, and for 2d-surfaces 
simmilar structure, but each parent have 4 childs. And for 3 directions - 8 
childs. 

> Apart from that you may want to do some profiling before you jump to
> the conclusion that the tree searchs are slow rather than more
> frequently used code (such a the priority queue for photons).  If
> there is any benefit from using an oct-tree for photons may sound like
> an interesting question, but without a very good understanding of
> photons that is not easy to answer, let alone implement.

I found in help :
 The keyword gather allows you to specify how many photons are gathered at
 each point during the regular rendering step.
so I was wrong, more photons are gathered during render also.

One uf my ideas was to generate standart texture (image-map) during 
shooting, and just lay it on may texture of collecting object.

I will try to do this for plane - to warm up with patching POV.
Idea is simple, is stored surfaced photon is saved to hdd in <x,z> foramat.
Test scene is somthing like :
  plane{y,0} sphere{..glass.. photons { refract 1 target } }
Then, my program generates .bmp texture basing on data saved during 
shooting. In final step - i render image with no photons, but using 
image_map on plane instead.

I hope it would bring a big difference in speed, and that it could be used 
to speed up other shapes in next versions



-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

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