Experimenting with lens flare entirely within Octane

Forums: Experimenting with lens flare entirely within Octane
Generic forum to discuss Octane Render, post ideas and suggest improvements.
Forum rules
Please add your OS and Hardware Configuration in your signature, it makes it easier for us to help you analyze problems. Example: Win 7 64 | Geforce GTX680 | i7 3770 | 16GB

Experimenting with lens flare entirely within Octane

Postby treddie » Thu Aug 30, 2012 5:05 am

treddie Thu Aug 30, 2012 5:05 am
I have been wanting to do this for a loooong time. I originally wanted to try it in Maxwell Render many years ago, but decided against it, since the first proton in the Universe would have decayed before anything useful came out of Maxwell. :)

(Sorry Next Limit...Great program, but CPUs bad...GPUs good!)

Anyway, I wanted to do lens flare effects inside an unbiased-renderer. The only way to do that without code such as that designed by Hullin, Eisemann, Seidel and Lee ("Physically-Based Real-Time Lens Flare Rendering"), is to build an actual compound lens in 3D and place the Octane camera inside it, while it looks backward at the focal plane. The code mentioned above has been around for more than a year, I think, but it does not appear that anyone is bothering to incorporate it into their programs yet. Possibly the creators of it are asking too much money, maybe they're sitting on it for now...Who knows.

Modeling the virtual camera for this experiment was very easy and straight forward...The hard part was the time in doing an Internet research to locate any accurate engineering drawings or patents of various lenses. I eventually found a bunch of lens patents via http://www.patentlens.net/. Of key importance is that all lens element radii of curvature and distances between the elements are noted as well as the IOR of each element (Compound lenses do NOT use the same IOR for all elements).

So here are the results. The image on the left is completely done within Octane (no post in Photoshop). The image on the right is with post work since Octane does not yet handle the Fraunhofer equations for starburst patterns that are found around bright light sources. These star patterns are the result of the diaphragm within the lens system and change according to the size of the aperture, and the amount of blades that form its sides. Hopefully, Octane will handle apertures in the future!

Test v7 Figure 1.jpg


Curiously, I found an odd issue in Octane when setting up the light sources. There are two sources...The HDR background, and an emitter ball just above the fire extinguisher bottle that is casting the flare effects. Whenever I would change the intensity of the emitter ball, the HDR would change in intensity, too, as if it were just another surface lit by the ball! Clearly, if the ball is reduced to zero intensity, the HDR should remain unaffectedly bright. This was not the case. I thought it might be that the ball (being as bright as a little Sun) might be filling the lens with light fill, but if this were true, then removing the ball entirely should still not affect the HDR in any way. I found that I had to orchestrate the intensities of the HDR and the ball to get things to work. Now, I may be doing something stupid in that respect so that it SEEMS that the ball is coupled to the HDR, but don't really know for sure. Below are two examples with ball at 1000W and one at 10W.

Test v7 Figure 2.jpg


One other note...I found that unless I increased PMC Max Depth and Exploration Strength, and lowered Direct Light Importance, all of the lens reflections would not render. If I understand it correctly, Octane simply moved on to other rays at some cutoff point. If this is true, then the drawback of doing all of this is that a good portion of the render is spent calculating reflections and light effects inside the virtual camera, let alone having to render the scene itself! So I have no idea what would happen if, for instance, you tried to render a scene whose main subject was another lens seen head on with all of the reflections you would see in it.

Overall, I did not get the impression that the virtual camera overhead was all that bad. I will no more when I try a complex scene.
Last edited by treddie on Thu Aug 30, 2012 6:10 am, edited 1 time in total.
Win7 | Geforce TitanX w/ 12Gb | Geforce GTX-560 w/ 2Gb | 6-Core 3.5GHz | 32Gb | Cinema4D w RipTide Importer and OctaneExporter Plugs.
treddie
Licensed Customer
Licensed Customer
 
Posts: 739
Joined: Fri Mar 23, 2012 5:44 am

Re: Experimenting with lens flare entirely within Octane

Postby roeland » Thu Aug 30, 2012 5:35 am

roeland Thu Aug 30, 2012 5:35 am
The PMC kernel can get the overall brightness wrong if there is a very bright object in the scene. Does the brightness go down if you let it render for a while ?

--
Roeland
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1811
Joined: Wed Mar 09, 2011 10:09 pm

Re: Experimenting with lens flare entirely within Octane

Postby treddie » Thu Aug 30, 2012 5:47 am

treddie Thu Aug 30, 2012 5:47 am
Hi Roeland.

Hm, funny you should mention that. In this test, no. Intensity increased with time as with a normal render. But I DID notice that in my prism experiment. I was checking that the light from the laser tube was making it through the prism, so I faced the camera straight down the tube as seen in the prism, and under certain conditions DID notice it, which was the first time I had experienced that before.
Win7 | Geforce TitanX w/ 12Gb | Geforce GTX-560 w/ 2Gb | 6-Core 3.5GHz | 32Gb | Cinema4D w RipTide Importer and OctaneExporter Plugs.
treddie
Licensed Customer
Licensed Customer
 
Posts: 739
Joined: Fri Mar 23, 2012 5:44 am

Re: Experimenting with lens flare entirely within Octane

Postby treddie » Thu Aug 30, 2012 8:02 am

treddie Thu Aug 30, 2012 8:02 am
Here is the virtual camera modeled with lens elements from a French design from 1955. This is one of the lenses used as an example in the SIGGRAPH paper mentioned above. Tracking that down led to the actual patent, and then a great source for more lenses (including a zoom lens with a ton of lens elements which would be great for a really complex lens flare...If Octane can keep the bounces going!). In addition, I started working with lens coatings, then backed off so that I could just get the basic principle working first. That should add varying colors into the aperture shapes.

The Camera.jpg
Win7 | Geforce TitanX w/ 12Gb | Geforce GTX-560 w/ 2Gb | 6-Core 3.5GHz | 32Gb | Cinema4D w RipTide Importer and OctaneExporter Plugs.
treddie
Licensed Customer
Licensed Customer
 
Posts: 739
Joined: Fri Mar 23, 2012 5:44 am

Re: Experimenting with lens flare entirely within Octane

Postby Refracty » Thu Aug 30, 2012 10:06 am

Refracty Thu Aug 30, 2012 10:06 am
Very nice test treddy.
I am wondering - If Octane is physically correct that would mean that blurred objects will have a 'real' bokeh depending on the lens sutter blades.
I hope that they will work on this (apperture, bokeh, star glow,ect...).
User avatar
Refracty
Licensed Customer
Licensed Customer
 
Posts: 1598
Joined: Wed Dec 01, 2010 6:42 pm
Location: 3D-Visualisierung Köln

Re: Experimenting with lens flare entirely within Octane

Postby treddie » Thu Aug 30, 2012 7:45 pm

treddie Thu Aug 30, 2012 7:45 pm
Hm, good point. It is easy enough to test...I had stopped my aperture all the way down to get as close as possible to infinite DOF. In previous tests, I had the aperture wide open and did not notice any bokeh in the out-of-focus areas. I will have to open up the aperture again and let the image render long enough to see if it is there or not.
Win7 | Geforce TitanX w/ 12Gb | Geforce GTX-560 w/ 2Gb | 6-Core 3.5GHz | 32Gb | Cinema4D w RipTide Importer and OctaneExporter Plugs.
treddie
Licensed Customer
Licensed Customer
 
Posts: 739
Joined: Fri Mar 23, 2012 5:44 am

Re: Experimenting with lens flare entirely within Octane

Postby Refracty » Thu Aug 30, 2012 8:15 pm

Refracty Thu Aug 30, 2012 8:15 pm
For me it seems that what you have said about closed apperture (star shape does not appear) applies to the bokoeh that shows up with small fstops.
I guess ,the apperture setting is not really physical correct. Usually apperture and fstop mean basically the same thing but Octane handles them independly.
User avatar
Refracty
Licensed Customer
Licensed Customer
 
Posts: 1598
Joined: Wed Dec 01, 2010 6:42 pm
Location: 3D-Visualisierung Köln

Re: Experimenting with lens flare entirely within Octane

Postby treddie » Thu Aug 30, 2012 8:48 pm

treddie Thu Aug 30, 2012 8:48 pm
I hadn't thought about that, but yah, you're right. Also, invoking "aperture" brings up the question, "Which aperture?" 5-sided? 6-sided? 8? Ideal circle?...
Win7 | Geforce TitanX w/ 12Gb | Geforce GTX-560 w/ 2Gb | 6-Core 3.5GHz | 32Gb | Cinema4D w RipTide Importer and OctaneExporter Plugs.
treddie
Licensed Customer
Licensed Customer
 
Posts: 739
Joined: Fri Mar 23, 2012 5:44 am

Re: Experimenting with lens flare entirely within Octane

Postby roeland » Fri Aug 31, 2012 12:36 am

roeland Fri Aug 31, 2012 12:36 am
Octane assumes a circular aperture.

The F-stop setting in the exposure settings is only used to change the exposure, it is not used to calculate the physical size of the aperture.

The aperture setting in the camera settings gives the radius of the aperture in centimeters.

In a camera the F-stop is the ratio between aperture size and focal length, and the focal length and the size of the film or sensor in the camera determine the field of view. So different sensor sizes and different field of view angles will give different aperture sizes for a given F-stop. We don't have a mechanism in Octane yet to automatically calculate this aperture size yet.

--
Roeland
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1811
Joined: Wed Mar 09, 2011 10:09 pm

Re: Experimenting with lens flare entirely within Octane

Postby treddie » Fri Aug 31, 2012 1:39 am

treddie Fri Aug 31, 2012 1:39 am
Octane assumes a circular aperture.


Are there any plans to include more complex apertures (amount sides to the aperture) and are there any plans to handle Fraunhofer and Fresnel diffraction caused by the aperture?
Win7 | Geforce TitanX w/ 12Gb | Geforce GTX-560 w/ 2Gb | 6-Core 3.5GHz | 32Gb | Cinema4D w RipTide Importer and OctaneExporter Plugs.
treddie
Licensed Customer
Licensed Customer
 
Posts: 739
Joined: Fri Mar 23, 2012 5:44 am
Next

Return to General Discussion


Who is online

Users browsing this forum: No registered users and 15 guests

Wed Apr 24, 2024 11:16 am [ UTC ]