PDA

View Full Version : Fake DOF BG with refraction?



objuan
02-11-2016, 02:22 PM
Is there any quick cheater way to blur some objects in a scene and not others?

In my case I want to rotate around an object, which has some refractive glass elements, in the center of my scene. I want all of the BG to be blurry, and I want that blurrized BG to be refracted/reflected in my FG crisp glass and other elements.

In point of fact, in this particular case since my BG is more or less a room with some nernies on the walls, I could probably render some stills of each wall, blur them in PS, and then texture them back on to a 'blurry' version of my room.

Still, I'd like to know about other ways to go about this, specially if some day I wanted to do it for a more expansive landscape...

Kaptive
02-11-2016, 02:59 PM
Well, just to make the technique you mention above a little easier make an environment map instead.

To do this, firstly, place your camera with no rotation in the centre of your room/environment. Then, just change the camera to advanced camera (top drop down) then set Horizontal FoV to Cylinder 360 degrees and Vertical FoV set to cylinder 180 degrees.
Then set your camera to be a square image (say 2000x2000 or bigger)... hit render and then you have a single image that can be either mapped on a poly flipped sphere with 100 luminosity (no diffuse or spec) or simply use it as a textured environment (Effects panel/backdrop tab/add environment dropdown)... click on the texture button, and then when it opens, in the texture panel, set orientation to Y on a spherical map and add your image.

That way you only need a single image and rather than bluring it in photoshop, just use the image filter "full precision blur" to alter the blur in a non destructive way.

Not sure how clear these instructions are, with 447 posts though, hopefully you should understand what I mean :)

Oh! In fact, here, I found a shortish tutorial that will explain it much better! V9, but still the same as now. http://www.peteryu.ca/tutorials/lightwave/advanced_camera_panoramas

EDIT: Also, I'd follow the tutorial link I sent, as I think I'm probably out on a couple of details... trying to do it from memory!

objuan
02-11-2016, 03:28 PM
That is good thinking with the advanced camera render. Refracting a sphere wont really behave the same as refracting my room (it's actually inside a tetrahedron room) but I imagine it will work fine for my purposes. (Come to think of it, can I spherically map said 360 view onto my tetrahedron and have it look fine?)

Still would be curious if there is a way to specify blur on certain objects only though? Or say based on distance from camera. - Might be fun to blur just one object in the FG, like in that Woody Allen movie where Robin Williams could't shoot because he had gone out of focus.

Thanks.

"Oh I love Woody Allen movies, except for that nervous guy who is always in them." - Ned Flanders

spherical
02-11-2016, 04:05 PM
That is good thinking with the advanced camera render. Refracting a sphere wont really behave the same as refracting my room (it's actually inside a tetrahedron room) but I imagine it will work fine for my purposes. (Come to think of it, can I spherically map said 360 view onto my tetrahedron and have it look fine?)

Thinking into the physics of this, you're "baking" the tetrahedron into the image. The Spherical map should reproduce it without introducing a secondary distortion.

MonroePoteet
02-13-2016, 08:44 AM
It may be that the refracted background shouldn't be blurry. Optics isn't my speciality, and often seems non-intuitive to me, but if the refractive pieces of your object are "wide angle", I don't think the background would be blurry in them if the rest of the object is sharp in the DOF distance.

I did a test scene (attached) with both a (poorly modeled so has a central "star" artifact) wide-angle lense and a magnifying lens. They move away from the camera while the DOF distance follows them from frames 0-60, then the DOF distance is shortened from 60-90, then extended from 90-120. In the final animation, the blurriness of the images in the lenses seems right to me with no tweaking. Maybe not. And, of course, you may just want the BG blurred in the refractive piece for effect anyway.

There's also a small render in the ZIP file, which you might want to play at 1/4 speed to see the various changes in DOF distance. Took a long time to render because I bumped up the Motion Blur Passes to 12 to get a nice smooth DOF blur.

I don't know for sure, though.

mTp

spherical
02-13-2016, 02:09 PM
Optics is one of mine. This all depends upon the shape of the refractive object that is between the eye and the BG. If its focal length is between certain limits for a given set of distances, the overall DOF will be overridden and rays coming though the object will be sharp to one degree or another. IOW, there is an additional lens in the path that refocuses the rays.

MonroePoteet
02-13-2016, 02:30 PM
Yes, thanks for the good description. That seems to be what's happening with LW's calculated refraction. At frame zero when the lenses are in focus, the image in the wide-angle lens is clearer than the DOF blur on the object in the background. I didn't play with the curvature of the wide-angle lens to "perfect" it's focal length for the distances in the scene.

So, I guess my overall perspective would be to trust LW's calculated DOF blur for the shape and index of refraction of the intervening geometry(s). If the refracted image is clear when the object itself is clear, it's probably close to what would happen in real life. Again, not completely sure, though.

mTp

objuan
02-15-2016, 12:35 PM
From my imagined understanding of optics, I would guess that refraction of the bg should be crisp in a focused fg object, even if the bg is all blurry.

However, for my 'artistic' purposes, I want the focus to be on the foreground floaters. As it turns out, so far I am pretty happy with my typical approach of setting my bg objects to render with a Constant Black alpha, and then in AE duplicating the layer, and setting the bottom layer to have a Shift Channels - Alpha: Full On, and an adjustable Fast Blur, with the top layer using the the alpha and not being blurred, like so:
132405

Still though, I dont know why exactly, but I would like to be able to selectively blur certain objects in LW...?

MonroePoteet
02-15-2016, 02:02 PM
You might be able to use the "jittered motion blur" I suggested in this thread:

http://forums.newtek.com/showthread.php?148167-Partial-motion-blur&highlight=blur+some+objects

The basic idea is to add a high-speed Oscillator modifier (under the Modifiers tab of the Graph Editor) to one or more channels (say the X,Y,Z Scale) enable PhotoReal Motion Blur, and adjust the amplitude of the oscillator(s) or the particular channels affected to get the amount of blur you want

mTp

spherical
02-15-2016, 04:05 PM
From my imagined understanding of optics, I would guess that refraction of the bg should be crisp in a focused fg object, even if the bg is all blurry.

Actually, no.

http://forums.newtek.com/showthread.php?149679-SPEED-MODELING-CHALLENGE-quot-Out-of-Time-Archaic-Time-Measurement-quot&p=1466066&viewfull=1#post1466066

To be more detailed in your situation, the refraction can be in crisp focus if the intervening optics are in a correct shape to do that. In all cases, no.