View topic - Two suggestions: photon bucket, and projector masking

Two suggestions: photon bucket, and projector masking

General questions related with the YafaRay Project, 3D computer graphics and about this site.

Two suggestions: photon bucket, and projector masking

Post Tue Nov 15, 2016 2:01 pm

Hi all. Sorry if my topic in the wrong place, but I did not find special branch with suggestions.

I am new with YafaRay. I like how renderer works and I like the results that SPPM and Path+Photon can deliver. After hours of playing with photon rays I found one thing and have one idea to make photon-projectors more efficient.

So here my suggestions.
1) rectangular/square projector.
2) elliptical projector.
additional: projectors with size (not just point, but circle/square) to make softer caustics for sharp materials. Or multimaterial, like in Cycles, that will look sharp for camera but soft for lightsource.
First two are custom and useful shapes, and simplier solution, than next two.

3) When I am masking projector with black texture, most of photons are dying on the mask. But using memory and calculations. I think, that with mask they should not be shot for totally black pixels and if pixel is semitransparent, it should proportionally emit less photons. Just because they limited.

The more complex system

4) Photon Bucket.
Lets look at the meshlight.
photon bucket.png
Meshlight with photons

Now it is emitting 180°.
To make awesome caustics we neen only rays, marked green, directed on the target mesh.
But most of photons are go somewhere else.

So here some solutions from complex to more complex.
photonbucket2.jpeg
Schemes of photon bucket


a1) simple photon bucket. Shape of limitter is the same as shape of lightmesh. Rays can be shooted only through limitter shape (mesh, or 2d-curve). It`s distance and size can be changed with parameters.
a2) complex photon bucket. Limitter can have different shape.
b) the bestawesome solution. Photons are shooted only from meshlight to target object or few oblects, that hava materials that makred as «caustic active».
But I know that this case needs projection of mesh for each shoot. And it is too much calculations. So it is enouh to have few approximate shapes for few points of lightmesh, that covers all mesh with additional threshold. Or may be very simple math-proxy for target mesh, that easier to calculate (spheres, boxes, capsules).


http://graphics.pixar.com/library/Optim ... /paper.pdf — may be this will help with blending shapes. Pixar have very useful library.

Thank you for your attention. Feel free to say ypou opinion about all this.
And one nice picture. Light is caustic too.
SPPM Suzanna.png
SPPM, light is caustic too (meshlamp with parabolic reflector). About 2hrs of testing, 15 minutes of render and 15 minutes of drawing and manual denoising.
hitrpr
 
Posts: 5
Joined: Mon Nov 14, 2016 12:13 am

Re: Two suggestions: photon bucket, and projector masking

Post Tue Nov 15, 2016 4:23 pm

Yes this idea has ocurred to me before but I am a bit doubtful because it is yet another photon mapping temporary hack like portals or photons lamps. Also you need to balance power that gets towards the "projector" which is a subsample of the theoretical total caustic light emited by the source. I think projection maps is the right solution worth waiting for. BTW to target caustic photons I think that a bounding box will do for most cases.
User avatar
Samo
 
Posts: 3078
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Two suggestions: photon bucket, and projector masking

Post Wed Nov 16, 2016 9:01 am

2016-11-16_114346.jpg
Hi, thanks for reply.
But no, Bounding box is not effective with thin shapes.
Imagine glass tree or just torus. 90° of photons will be useless without map.

Also it is very easy to make stencil for point lightsource, just because it is 1 black projection of mesh.
The same one stencil can be blurred for round or rectangular projectors with round or rectangular spots (bokeh blurring).

Anyway, the first step, that will improve results veeeery much can be 1bit-map for projector, That just saying to shoot or not to shoot photon in these direction.
There is no problem in blender to draw such map manually:
2016-11-16_112124.jpg
Masking camera for path-rendering custom piece of scene.

But simple map it is a fast render, from lightsource like from camera, can be done right from viewport/opengl, like we are getting viewport frames.

IDK how projector works now and lights to cone. And I am not good an math. But I am good at algorythms. So if you show me math background of projector, I will help to find the solution.
My brain is bright enough to construct such 4-level procedure shader in Cycles (and useful staff for it like booleans, switch, and tricks with normals)
2016-11-16_113740.jpg
1st and 2nd levels of node

2016-11-16_114346.jpg

So I am little bit familiar with vector math
hitrpr
 
Posts: 5
Joined: Mon Nov 14, 2016 12:13 am

Re: Two suggestions: photon bucket, and projector masking

Post Wed Nov 16, 2016 1:58 pm

So here some pseudocode with comments and scheme for understanding. Feel free to ask me via hitrpr@gmail.com.

But I`m not a programmer. Just illustrator, who like to code sometimes.
scheme.png
Scheme of projection through stencil


PseudoCode1.c
May be this simpliest algorytm will help. It needs to be translated from projector`s localspace into space of scene, of course.
(3.35 KiB) Downloaded 47 times
hitrpr
 
Posts: 5
Joined: Mon Nov 14, 2016 12:13 am

Re: Two suggestions: photon bucket, and projector masking

Post Wed Nov 16, 2016 5:35 pm

Hello, hitrpr

Thank you very much for your suggestions and the examples you have attached.

However, I have to confess I'm having a hard time trying to understand what are you trying to achieve here.

Are you suggestion a way to improve caustics photon mapping by limiting the shooting of photons to the "meshes of interest"?

Or are you requesting a new feature to implement light projectors?

Reading your posts, sometimes I think you are referring to the first, sometimes to the second and sometimes there is a mix of both.

If you just want to improve caustics, you can use two lamps:
* One with photon shooting disabled.
* The other, a spot light, with only photons, located in the same place where the first light is and manually focused on the mesh where you want to get good caustics.

This solution is certainly a patch and not physically correct. I understand that ideally we should only shoot photons at the objects, but in most scenes we have objects everywhere: walls, floors, ceilings, tables, etc. So, how can we say which objects we want caustics for and which not? Such discrimination would be complex and would still be physically incorrect, so I think in this case the best way would be to use the two lamps as I suggested. That way, you can choose exactly how you want photons to be directed to the scene.

I hope this helps you somehow. If you want I can provide an example.
User avatar
David Bluecame
 
Posts: 418
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Two suggestions: photon bucket, and projector masking

Post Wed Nov 16, 2016 6:38 pm

I have attached an example scene with two lamps:
* Point lamp, no photons
* Spot lamp, only photons, just for the monkey caustics
Attachments
photon-2lamps - 001.png
photon-2lamps.blend.zip
(85.73 KiB) Downloaded 50 times
User avatar
David Bluecame
 
Posts: 418
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Two suggestions: photon bucket, and projector masking

Post Thu Nov 17, 2016 8:57 am

Hi. Mainly I would like to improve caustic-projectors, to have not just sharp or smooth caustics. But projective image, through lenses. Imagine a window and a lens. It is very hard to fake such caustic with projector, because it is only 1 point. And hard with lightmesh, because it throws photons everywhere.

IMG0118A.jpg

IMG0119A.jpg


Sorry for bad quality. Truly this caustic much more detailed (with dispersion).

And when lens is moving, the caustic moving too.
So for beautiful fake I need a lot of scripting and second rendering from the view of lens.
hitrpr
 
Posts: 5
Joined: Mon Nov 14, 2016 12:13 am


Return to News & Discussion



Who is online

Users browsing this forum: No registered users and 7 guests

cron