View Full Version : Realistic Camera
dpont
07-07-2006, 05:06 AM
Hi,
This project has been made by Don Fussell for PBRT
(Physically-based Ray Tracer):
http://www.cs.utexas.edu/users/fussell/courses/cs395t/assignments/assignment3.html
May be this should take a lot of rendering time in LW?
...Not easy to build virtual parametric lens-shape,
and calculate ray intersection, refraction...
Preview of an utopic camera plugin (it works only as a LensViewer yet):
34013
Sample comes from "Modern Lens Design" which is an expansive book,
with ascii lens specification tables.
Denis.
dballesg
07-07-2006, 05:23 AM
Hi,
really interesting. And I like a lot how elegant and simple s your proposal for the plugin.
Maybe something like this would be really useful for arch viz and photographers as well.
Best regards,
David
dpont
07-07-2006, 05:52 AM
And matching real cinematographic footages...!?
Denis.
dpont
07-07-2006, 11:54 AM
In another hand, if we don't want to simulate
chromatic aberrations or dof,
There are calibration softwares which can measure distorsions,
34022
Then building a deformed plane in Modeler,
a job for "Mesh UV smooth" option in Advanced Camera ?
Denis.
Pavlov
07-07-2006, 07:19 PM
I think it could be really interesting, even if adding heaviness to the already slow LW engine looks odd.
Beside LW's limitatons, it's an elegant and useful tool; it would be a really nice add-on if it works with Kray or Fprime.
Just an hint and a hope, kudos for all your work btw ;)
Paolo
UnCommonGrafx
07-07-2006, 08:17 PM
Yes, yes, YES!
Jarno
07-07-2006, 10:40 PM
Adding realistic camera models to ACT is high on the list of things to do. I am well acquainted with the works that dpont references.
---JvdL---
dpont
07-08-2006, 02:45 AM
To complete previous calibration chart, tangentielle is V axis
and sagittale is U axis.
Sorry, if you think that some part of this thread
are too much esoterical or SDK relative, but I hope
we can do more accurate experiments with
"Advanced Camera" that only funny demos :-) and
psychedelic samples.
About "Realistic Camera" port,
not sure, to go far from single lens-viewer I have made,
original source takes shape from "pbrt" core,
(disk shape is pure "pbrt" function & lenscomponent from "RC" plugin).
To ask for intersection ray and to calculate normal
on lenscomponent' intersection point,
may be we need build our own ray-marcher function
for implicit surface in LW?
Don't know if fpx & fpy in Camera Handler
are correct input data for "pbrt" ConcentricSampleDisk
function as lensU and lensV.
Have not revised my optical knowledges since
I have left my school (a long time ago),
remember only a few things
about principal and focal points for a lens stack.
PS: Jarno, why hither and yon have been removed
from SDK? I Know there are still present...
Denis.
dpont
07-08-2006, 04:53 AM
All pages below are french but there are some nice java applets
to demonstrate some optical basics:
http://www.univ-lemans.fr/enseignements/physique/02/optigeo/rayons.html
(move yellow point to vary ray incidence)
http://www.univ-lemans.fr/enseignements/physique/02/optigeo/aberchro.html
(vary R, Y, B)
http://www.univ-lemans.fr/enseignements/physique/02/optigeo/zoom.html
(move L2 and keyboard arrows to focus)
...
Denis.
Pavlov
07-08-2006, 08:04 AM
now here's a "banality"... Maxwell's renderings have all a strong luminosity-contrast ramp from the center to the corners. Though it is not always a desiderable effect, it often gives a good depth and a "mod" to the pic.
Beside the fact it's doable in PS, is it a reproducible effect with ACT ?
Paolo
dpont
07-08-2006, 11:53 AM
Have not tested Maxwell, not seen this effect,
just found the "Simple Filter" in ACT and his associated
Texture panel, it has specific gradients for pixel
position such as "Radial Film Position", and you can
use classic "Blending Mode" popchoice for layers,
with "Mixing Filter" mode you can have
separate color filter effect.
May be this is the vignetting effect
http://www.vanwalree.com/optics/vignetting.html
(common aberration or stylistic effect)
But no luminosity-constrast effect, because Texture can't
have access and modify sampling data (ray value), you can
add, substract... texture layers.
Those modifications could be made with an Image Filter plugin,
vignetting or some other things,
you could add The Virtual Darkroom for lw,
or a desaturation depth effect for color, or external post-rendering
effect (not exhaustive).
Denis.
Pavlov
07-08-2006, 12:00 PM
hmmm it looks like it's just that vignette effect.
Never used Virtual Darkroom myself... if it is cabable of this ill try, maybe in post (render in fprime/Kray, then import image sequence and apply filters).
Maybe i could get it witha simple gradient too, applied to all surfaces and referencing a Null parented to Camera...
Paolo
Jarno
07-08-2006, 09:57 PM
Jarno, why hither and yon have been removed
from SDK? I Know there are still present...
Because it proved to be too bothersome for an ACT plugin to come up with a hither and yon distance that always worked consistently with the other things in Layout. So now Layout modifies the projection matrix returned by the ACT plugin to have the correct hither and yon distances.
---JvdL---
dpont
07-09-2006, 05:42 AM
So we can ignore hither and yon in projection preview,
confirmed with a working clone camera plugin of perspective camera.
I forgot to credit Nicolas Galoppo Von Borries,
Alan Jao, Murad Akhter and may be some other persons
in "Realistic Camera" or "Camera Simulator" project.
Here I have posted two samples illustrating uniformly sampled rays
coming from film in the direction of the back lens component and intersecting/refracting with each lenscomponent.
34124
Denis.
Pavlov
07-09-2006, 05:53 AM
apart from being first Sigr Ros's album, what is Yon - and hither too, in simple words ?
Paolo
dpont
07-09-2006, 06:26 AM
"hither, yon
The distance to the currently set near and far plane, primarily for use with the preview function. " (from the older beta 9 SDK doc)
Was used before in the (opengl) preview projection matrix,
no more needed, handled internaly by layout.
Denis.
jameswillmott
07-09-2006, 06:28 AM
Front clipping plane and rear clipping plane for OpenGL preview, if I'm not mistaken.
EDIT: Ah, Dpont got in just before me :)
dpont
07-09-2006, 09:43 AM
Trying to clarify some points about (still utopic) port
of "Realistic Camera" pbrt plugin to lw camera plugin,
understanding "pbrt" transformation matrix system
(I'm not thinking in C++), avoiding confusion between
film and raster coordinates, and leaving useless code.
Correct me if I'm wrong or miss something!
-In our lensviewer, we can parse lense-stack and store each
lens specifications (radius, zpos, ior, aperture).
-In lw camera evaluate function, we get film position,
camera world position and world camera orientation matrix.
-We must init our camera with its lens-system, Raster is
for pixel coordinates, but we have already film coordinates in LW,
we must translate our system with film distance to back lens.
-To generate ray, we build our beginning ray
in camera space translate to back lens distance with our film coordinates
we don't need concentric mapping (except if we want to do ray-samples
in our lens-viewer).
-We use "pbrt" disk (zero radius) and "RC" lenscomponent(sphere)
function to get dpdu & dpdv differential vector and then get the normal
to intersection by cross product, or nothing if there's no intersection.
-Compute refracted ray with this oriented normal (for convex or concave)
and take IOR from parsed lens data.
repeating for each lenscomponent.
-Finally transform resulted
ray direction in world system with camera matrix.
-We don't use Weighting factor (for exposure?)
("RC" link-references are on the top of this thread).
Denis.
Jarno
07-09-2006, 10:17 PM
apart from being first Sigr Ros's album, what is Yon - and hither too, in simple words ?
As mentioned, hither and yon are distances to the near and far clipping planes. They are conventionally called that because "near" and "far" tend to be reserved words in many C and C++ compilers, so can't be used as variable or parameter names.
---JvdL---
(who missed a Sigur Ros concert to work on LW9)
((and it was "Von", not "Yon" :) ))
()
dpont
07-10-2006, 08:56 AM
..."we have already film coordinates in LW"...
In fact we get (centered) normalized film coordinates in LW camera,
so here we need the film resolution diagonal (from filmsize?) and real film diagonal from panel request,
to get a scaling factor for a real film position, and then the ray
we are evaluating.
-Major difficulty for me, comes from different coordinate
systems (Camera, Object, World) and each
specific space-transformation we need for each step.
Disk and lenscomponent function operate in object space,
to get derivatives, but normal intersection is calculated
in world space, these transformations are simple positive
or negative translations on the optical axis, given the distance from
each lenscomponent to front stack-lens.
-From first idea about ray marcher, we keep only a basic
function to compute lensComponent hit position (intersection).
A lot of possible errors or mistakes in calculation...
Wrong?Tedious?
Could someone upload a Carl Zeiss Lens specification :-)(ascii file)?
Denis.
dpont
07-10-2006, 09:11 AM
Lens specification sample :
# Muller 16mm/f4 155.9FOV fisheye lens
# MLD p164
# Scaled to 10 mm from 100 mm
# radius sep n aperture
30.2249 0.8335 1.62 30.34
11.3931 7.4136 1 20.68
75.2019 1.0654 1.639 17.8
8.3349 11.1549 1 13.42
9.5882 2.0054 1.654 9.02
43.8677 5.3895 1 8.14
0 1.4163 0 6.08
29.4541 2.1934 1.517 5.96
-5.2265 0.9714 1.805 5.84
-14.2884 0.0627 1 5.96
-22.3726 0.94 1.673 5.96
-15.0404 0 1 6.52
Denis.
Jarno
07-10-2006, 09:39 PM
In fact we get (centered) normalized film coordinates in LW camera, so here we need the film resolution diagonal (from filmsize?) and real film diagonal from panel request
The camera handler evaluate function is called with position in film coordinates. Film coordinates are centred on the film, but not normalized. The position is given in metres.
---JvdL---
Panikos
07-18-2006, 08:15 PM
Very interesting all these :dance:
Paolo, vignetting can added with many many ways without calculations, using Advanced Camera, or an ImageFilter or ImageProcessing Foreground, or using a Compositing App.
As far as non-linear light sampling, Virtual Darkroom works great as a post effect though is a bit difficult to jump into it
Thank all for useful info
Bon chance
:thumbsup:
Panikos
07-20-2006, 08:33 PM
The biggest camera was manufactured in 1900 in USA. Due to its dimensions was called "Mammoth"
The train company "Chicago & Alton" asked for this camera in order to shoot its new luxurious train.
The camera weight was 635 kilos and required 15 people to operate it.
A photograph had dimensions 1.4 x 2.4 m and required 45 litres of chemicals in the darkroom.
:D
Pavlov
07-22-2006, 05:54 AM
ehhh i know about Image processing.... but since Fprime cannot see them, they dont exhist ;)
Paolo
dpont
08-02-2006, 11:49 AM
Just an piece of text I have read about NT at SIGGRAPH:
"With the addition of Advanced Camera Tools (ACT) in LightWave v9, LightWave now sets the standard for the ability to recreate any real-world camera and provides a selection of cameras perfect for film and television use, and ideal for architecture and visualization. The new capabilities showcased at SIGGRAPH will include two sample cameras, a RealLens and a two-point perspective. The RealLens camera applies lens distortions in images based upon data files describing the characteristics of real camera lenses. The two-point perspective camera is useful for traditional architectural renderings."
May be in the next Open Beta?...
Denis.
Pavlov
08-02-2006, 12:04 PM
i guess 2-pts perspective is derived from J.Wilmott's (mmmh yes maybe he's the one, maybe i'm wrong - just look in beta threads) "Architectural camera".
Nice to hear they implemented it, good Viz move.
Paolo
Karmacop
08-02-2006, 09:00 PM
Not derived from from, that'd suggest that James had something to do with it (and I'm making and assumption that he wasn't). You can do 2 point perspective with the advanced camera too, James' camera is just quicker to set up :)
Panikos
08-18-2006, 04:00 AM
I saw the recent LW9.* videos.
Realistic Camera is cool, however I see a small weakness.
Some imagefilters are HDR sensitive, like HDR_Exposer, LWVDR, or any colour processing filters.
Vignetting should be applied as the last filter, a separating plugin using values retrieved from the Camera Lens, eitherwise Vignetting becomes a parameter for invalid calculations.
Of course, I am only guessing, havent tried the tool in practice or saw it in real application.
Pavlov
08-21-2006, 07:25 PM
I saw some Vray 1.5 demos, it features (also) nice realworld cameras.
These seems to give the same vignette results as Maxwell. This vignetting seems to be "non linear", it seems to feel local image's exposure so it's not present everywhere or not in the same amount.
Adding a simple vignetting in post is easy but it is not as "scientific" as the one which derives from real camera calculations.
Since we're getting real cameras, is there any chance they gives this effect ?
Paolo
jameswillmott
08-21-2006, 09:18 PM
I saw the recent LW9.* videos.
Realistic Camera is cool, however I see a small weakness.
Some imagefilters are HDR sensitive, like HDR_Exposer, LWVDR, or any colour processing filters.
Vignetting should be applied as the last filter, a separating plugin using values retrieved from the Camera Lens, eitherwise Vignetting becomes a parameter for invalid calculations.
Of course, I am only guessing, havent tried the tool in practice or saw it in real application.
Vignetting occurs within the lens system, so by the time the light reaches the film it has already been affected. Image filters should then work on top of this, so realistically speaking, the order of what's happening is correct. In the final version I'm sure you'll be able to turn vignetting off if you want though.
Panikos
08-22-2006, 12:52 AM
James, thanks for the reply.
I know what you mean, that vignetting is a lens effect.
The problem begins when someone wants to use Sasquatch which is a PixelFilter. Sasquatch composition at the frame borders wont have vignetting.
Since Pixel/Image Filters are effects that are related to the camera, any Camera plugin developer should consider these relations.
Its painful to have two cool tools that cannot coexist and often there arent any workarounds.
:(
jameswillmott
08-22-2006, 02:12 AM
Ah, I understand where you are coming from now. Yes, I can see the problem, thanks for explaining it.
Panikos
08-23-2006, 10:45 PM
Developers understand me better, or my communication with them had been always very constructive.
dpont
08-24-2006, 09:56 AM
Not really studied this question,
but there are LWCamera Evaluation Functions in SDK which
(I guess) may be, can be called from Pixel Filter Handler,
a Camera evaluator with same functions than Camera handler.
Denis.
Panikos
11-07-2006, 01:30 AM
Seems that nobody saw this thread.
As I saw the development, the RealLens Camera destructs all Pixel Filters and all Image Filters.
Is there anybody at Newtek that has knowledge and plans ?
:cursin:
Pavlov
02-27-2007, 03:47 AM
James, your Tilt-shift camera cannot be saved into a scene. If i sacve a scene with it, when i reload it the plugin is missed and it asks for it. Is there any solution for this ?
thanks,
Paolo
Yes I'd like to see that solved too... It has happened to me to forget to turn back to tilt-shift camera after a scene load and frames went bad...
Pavlov
02-27-2007, 05:07 PM
fortunately we have also a jap plugin, "perspective control camera", which is even more capable of Tilt-shift and doesnt give these problems, though it's less immediate to use.
Paolo
UnCommonGrafx
02-27-2007, 06:06 PM
So those other cameras have been updated? Haven't been paying attention...
Pavlov
02-27-2007, 06:24 PM
yes so it seems. the one i mentioned above works perfectly and it can be saved with scene.
Paolo
jameswillmott
02-27-2007, 06:35 PM
James, your Tilt-shift camera cannot be saved into a scene. If i sacve a scene with it, when i reload it the plugin is missed and it asks for it. Is there any solution for this ?
thanks,
Paolo
Hi Paolo, yes we're working on that. I'll have it fixed soon.
jameswillmott
02-27-2007, 06:43 PM
This one should save and load just fine. Clear the old plugin and load this one.
Pavlov
02-28-2007, 03:17 AM
James, thanks for this nice contribute again ;)
Paolo
james, I get "Plugin shift Camera of incorrect version" error and then my LW crashes. LW9.0 here...
jameswillmott
02-28-2007, 10:05 AM
Sorry Jure, this plugin is for 9.2 only. The SDK's for camera plugins aren't compatible between 9.0 and 9.2. I can recode for 9.0 if you need it though, just send me a private message.
Gregg "T.Rex"
03-20-2007, 11:28 AM
Cool thread!
Bump!
:D
tajino
03-21-2007, 12:08 PM
James, I just tested your tiltshift camera with Fprime3, doesn't seems to render correctly, renders an expanding ring the higher you tilt the camera, wonder what might be the problem.
Similar error happens to the colm's (the cool museum) PerspectiveControlCam 0.15.
44182
confirmed! On the other hand I cant get Fprime3 working correctly with some of the advanced camera parameter either. Maybe it's an Fprime issue?
Pavlov
03-21-2007, 01:17 PM
damns this is BAD ! i need ACT more than nodes.
Hope worley fix this asap (or cameras get updated for fprime- who knows).
Paolo
tajino
03-21-2007, 01:20 PM
probably... however I managed to get the same tiltshift effect with advanced camera and fprime, setting the ray direction thru a null's XY. Works nicely with fprime. but down side is no viewport GL preview, at least there is fprime3 to aid the setup process.
Pavlov
03-21-2007, 01:37 PM
damn hoped at least PerspectiveControlCamera worked, i use it badly.
Someone must tell Worley this, hope it fixes it before he sends me download email... eheh
Paolo
tajino
03-21-2007, 01:41 PM
I just reported the situation to Worley, hopefully he's free enough to look into it. Let's all hope.
Hehe I doubt he's free this last days.. but let's see... :)
tajino
03-21-2007, 02:31 PM
Hey Pavlov, here is a temporary workaround that i've setup to get viewport preview as well as fprime3 to render the tilt shift cam.
the values are tied to the control null, move Z to adjust zoom and X and Y for tiltshifting.
the GLpreview cam is a colm perspectiveControlcam, and FprimeRendercam is LW advanced cam. Only the GLpreview cam and control null need to be touched.
both camera almost look alike, just need some minor tuning and they'll look exactly alike.
44188
You rock tajino! :beerchug:
Where have you been hiding last few weeks anyways? :)
tajino
03-21-2007, 03:05 PM
Unfortunately, at the moment it only works with the default frame aspect of 640x480, with multiplier is ok, both cam seems to take the values in an inverse manner, got to figure this out futher.
You rock tajino! :beerchug:
Where have you been hiding last few weeks anyways? :)
have been busy with jobs with crazy datelines..
Pavlov
03-21-2007, 04:25 PM
tajino, thanks so much i'll test it as i get fp3.
If worley has not fixed it by then, btw ;)
Paolo
jameswillmott
03-21-2007, 05:26 PM
Hi everyone, I've sent Steve a copy of the lens shader this morning as well as links to this thread, I'm sure we can work out if it's something I need to change, something FPrime needs to change or whatever. When I find out the answer I'll let you know.
Panikos
03-21-2007, 05:31 PM
I tried all Camera plugins.
Only TiltShift & Architectural Cameras crashed.
They began to render though textureless polys, then voom !
Weird :phone_cal
Awesome :thumbsup: many thanks for this tajino
Hey Pavlov, here is a temporary workaround that i've setup to get viewport preview as well as fprime3 to render the tilt shift cam.
the values are tied to the control null, move Z to adjust zoom and X and Y for tiltshifting.
the GLpreview cam is a colm perspectiveControlcam, and FprimeRendercam is LW advanced cam. Only the GLpreview cam and control null need to be touched.
both camera almost look alike, just need some minor tuning and they'll look exactly alike.
44188
jameswillmott
03-22-2007, 08:25 AM
Hi all,
I've made some changes to the tiltshift lens, I'm hoping it plays nicely with FPrime now. Thanks to Steve Worley for his insight into getting this to work.
PC only for the moment, sorry Mac guys, but I AM working on a port.
tajino
03-22-2007, 09:39 AM
Great!, I'm testing it now. Thanks a lot!!!
Thanks james! It seems to work great now!
tajino
03-22-2007, 09:49 AM
It works! It works!!, thanks again James. :thumbsup:
44244
awesome - thanks a bunch James & Steve :thumbsup: :thumbsup: :thumbsup:
3dworks
03-22-2007, 06:40 PM
Hi all,
I've made some changes to the tiltshift lens, I'm hoping it plays nicely with FPrime now. Thanks to Steve Worley for his insight into getting this to work.
PC only for the moment, sorry Mac guys, but I AM working on a port.
oh i like the 'AM' :)
thanks!
markus
-EsHrA-
05-24-2007, 12:49 PM
many thanks! wicked.
mlon
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.