## UPS vs VCM?

Practical and theoretical implementation discussion.
MohamedSakr
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

### UPS vs VCM?

* I wanted to ask if any one has compared both algorithms before so I can find which one would be better? , as they both seems to be very close to each other in the basic idea of (SPPM + BDPT vs VM + BDPT)

* another question is:does VCM handles DoF, motion blur correctly? "I think UPS should handle this as SPPM handles these kind of effects"

* lastly, does VCM algorithm portable to GPU?

MohamedSakr
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

### Re: UPS vs VCM?

I asked this question from like 5 days "I've read a lot since that time )

so the questions has totally changed!!

* is there a big difference between VCM and UPS? "in other words which parts should I change to convert smallVCM to UPS"
* how to add motion blur, DoF, full spectrum to the integration equation "I have read this thread viewtopic.php?f=3&t=1845&p=4122&hilit=vcm "

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

### Re: UPS vs VCM?

MohamedSakr wrote:* is there a big difference between VCM and UPS? "in other words which parts should I change to convert smallVCM to UPS"
The answer is surprisingly simple: nothing The actual algorithm you need to implement is the same for both methods. The VCM and UPS papers simply arrive at this algorithm in different ways.
MohamedSakr wrote:* how to add motion blur, DoF, full spectrum to the integration equation "I have read this thread viewtopic.php?f=3&t=1845&p=4122&hilit=vcm "
DoF is straightforward, as is done as in BPT. It is just another sampling dimension (inside the camera). The above mentioned thread already discusses motion blur and spectral rendering. An alternative approach is mentioned in this presentation on page 35.

MohamedSakr
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

### Re: UPS vs VCM?

I see
as those features will be the last thing to implement "luxury features " , I'm trying to implement a CUDA version now of smallVCM

in smallVCM, vertexcm.hxx, the code runs in this order (Generate light paths -> Build HashGrid -> Generate camera paths)

so there will be 2 kernels "with HashGrid built on CPU I guess" , the main question (does each pixel work independently from other pixels?) so I take each pixel in a thread safely without concern about other threads

edit:
I wanted to extract the direct illumination with VCM "I can do this with my own Naive methods" but as the rays/queries are already done, it would be better to extract the direct illumination (similar to camera rays which are reflecting/refracting and just stop at the first diffuse surface they hit and cast a shadow ray at that surface)

edit2:
after getting deeper in the algorithm, I find a very critical drawback!! , let's consider a camera inside a room, the scene got 20 different lights "an apartment for example", and only 2 lights will affect the room where the camera is located, so for rendering a full HD image, 2 million samples will be taken each iteration, and only less than 10% of these samples will actually affect the image

is this similar to how smallPPM works?

beason
Posts: 52
Joined: Sat Dec 10, 2011 1:58 am
Location: Los Angeles, CA

### Re: UPS vs VCM?

Perhaps in that last case you could benefit from "Robust Adaptive Photon Tracing using Photon Path Visibility".

tarlack
Posts: 27
Joined: Mon Feb 10, 2014 7:48 am

### Re: UPS vs VCM?

....or simpler methods based on prior analysis of the scene (with simple photon shooting for instance) and which computes the probability of each light based on its estimated contribution at the point of evaluation ?

MohamedSakr
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

### Re: UPS vs VCM?

beason wrote:Perhaps in that last case you could benefit from "Robust Adaptive Photon Tracing using Photon Path Visibility".
looks like a decent approach!!, so I should replace Mis with AMCMCPPM sampler?
tarlack wrote:....or simpler methods based on prior analysis of the scene (with simple photon shooting for instance) and which computes the probability of each light based on its estimated contribution at the point of evaluation ?
I thought of this approach actually! "but I thought that it is wrong of being too simple "

MohamedSakr
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

### Re: UPS vs VCM?

in smallVCM, I'm trying to "catch" only caustics, but couldn't find out how, I tried to output ConnectToCamera() only, but the result is all photons "not only caustics", what am I missing there to classify photons?

tomasdavid
Posts: 22
Joined: Wed Oct 10, 2012 12:41 pm

### Re: UPS vs VCM?

MohamedSakr wrote:in smallVCM, I'm trying to "catch" only caustics, but couldn't find out how, I tried to output ConnectToCamera() only, but the result is all photons "not only caustics", what am I missing there to classify photons?
You need ConnectToCamera for paths that have a flag that the previous interaction was purely specular.
I believe we have a flag like that already in, but cannot check now. If we don't, then adding one should be fairly trivial.
That gives you caustics as EDS(anything)

MohamedSakr
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

### Re: UPS vs VCM?

tomasdavid wrote:You need ConnectToCamera for paths that have a flag that the previous interaction was purely specular.
I believe we have a flag like that already in, but cannot check now. If we don't, then adding one should be fairly trivial.
That gives you caustics as EDS(anything)
yes I have noticed this and solved the problem, but extended it for latter use, so I can detect any path like SDS using the function SampleScattering(), so I create 2 more flags , if they remain true then it is a pure specular path, if 1 is false then it is SDS path, else is neglected