Planetside Software Forums

General => Terragen Discussion => Topic started by: ProjectX on January 07, 2007, 06:23:18 AM

Title: Distance Blur?
Post by: ProjectX on January 07, 2007, 06:23:18 AM
Are there any plans to implement distance blur into terragen? Maybe with settings to control the minimum focus distance and maximum focus distance? Such a shader would add hours to a render, but would make close-up or long-distance shots looks so much more real.

At the moment we could fake it with something like photoshop, but itwould be much better with varying degrees of blur, depending on distance.

BTW> distance blur is the effect of blurring far off things - and those close to you - to highlight the main point in the scene, it is used heavily in photography and film. When the cameraman focuses on two people talking in a movie, you won't generally be able to see much of the background or foreground - just the two people talking. Of course there are lenses that increase or decrease the effects of distance blur - so you don't always get it, but it is there.
Title: Re: Distance Blur?
Post by: oggyb on January 07, 2007, 08:15:49 AM
So you mean you want a focal plane on the camera system?  I think that would be rather exciting too :)
Title: Re: Distance Blur?
Post by: 3DGuy on January 07, 2007, 08:59:08 AM
It's called Depth of Field. It's not really controlled by the lens (i.e. the glass) but by the diaphragm ;) DOF in TG would be very cool.
Title: ZBuffer/RLA?
Post by: Igor on January 07, 2007, 09:47:14 AM
Or simply to have the ability to save the Images as RLA/RPF with ZBuffer :) In AE, Combustion, DFusion, PS2 etc you can then blur the depth as you want :)
Title: Re: Distance Blur?
Post by: MooseDog on January 07, 2007, 10:23:42 AM
QuoteOr simply to have the ability to save the Images as RLA/RPF with ZBuffer

planetside has stated, i believe, that render buffers and a slew of file formats will be available in the gold release of tg2.  all standard available buffers would be a great thing!

for a depth pass, you could pull it off right now with a brute force workflow.  just texture your terrain jet black, texture your atmosphere jet white, and then set-up a white fog, which you can then control density and distance.  presto! instant depth pass.

Title: Re: Distance Blur?
Post by: 3DGuy on January 07, 2007, 10:26:22 AM
I got this using a distance shader.
(http://temp.theglasseye.nl/doftest.jpg)
I applied a distance shader to the terrain which, set the ranges and used the resulting image as a mask for the lens blur function in CS2.

Drawbacks: I don't see a way to connect the distance shader to the clouds/atmosphere at the moment.
Title: Re: Distance Blur?
Post by: Njen on January 07, 2007, 10:32:55 AM
Yes, I have been unable to connect the distance shader to clouds/atmosphere myself...
I hope this is activated soon, as I have some great ideas that are waiting patiently in my head :)
Title: Re: Distance Blur?
Post by: buchvecny on January 07, 2007, 02:14:59 PM
theres plugin for Phtosho CS2, its called DOF pro developed by richar rosenmann i beleive... it simulates very good depth of field and i bet luc biancos used it in his images
Title: Re: Distance Blur?
Post by: semuta on January 07, 2007, 03:11:53 PM
IMHO, DOF blur in a terrain/landscape program... seems like it maybe should be the last thing on the list anyways, You won't normally get DOF in landscape photography, Unless there's say a branch 10cm to (at the outside) 3m from the lens and you're focusing on infinity or vice versa, even then you'd have to work for it. some large format cameras with the lens off angle from the focal plane will produce the effect of DOF over a large area, but again I wouldn't say it was "natural".. I guess my point is DOF on a landscape makes it instantly look like a miniature, like the image above.  If you want it, I'd say a z-depth pass and compositing is all you really need.
Title: Re: Distance Blur?
Post by: 3DGuy on January 07, 2007, 03:40:02 PM
Landscape photography usually uses the hyperfocal point which gives you the biggest DOF. Which means as much that everything is in focus. Only when focussing on a person or resonably sized object does smaller DOF come into play. So I would agree with semuta that this would currently not be in high demand right now.
Title: Re: Distance Blur?
Post by: oggyb on January 07, 2007, 03:45:33 PM
I'd hazard that it would be in high demand if enough people realised its power when composing a scene.  Depth of field is a creative tool as well as a scientific by-product.
Title: Re: Distance Blur?
Post by: firesuite on January 07, 2007, 04:09:01 PM
Quote from: oggyb on January 07, 2007, 03:45:33 PM
I'd hazard that it would be in high demand if enough people realised its power when composing a scene.  Depth of field is a creative tool as well as a scientific by-product.

I agree, i for one would love to know how this is done. Not every TG artist will adhere to the rules of Landscape photography/CG terrains while using TG2. From a creative standpoint this seems like a valuable tool to have as not every single artist using the software will be going for the "photo-realism"
Title: Re: Distance Blur?
Post by: Oshyan on January 07, 2007, 04:25:21 PM
We do plan to implement DoF natively in TG2. You will also be able to "roll your own" solutions using depth buffers and the like.

You can already connect the distance shader to the clouds, though not - I think - the atmosphere:
http://forums.planetside.co.uk/index.php?topic=111.0

- Oshyan
Title: Re: Distance Blur?
Post by: RealUser on January 07, 2007, 05:28:31 PM
DOF is certainly an artistic way to draw someones interest to a specific point of interest. In reality, DOF isn't very common to landscape photograhy. It is relative to close ups or macro photography, but not to wide angle shots. It depends on the focal length of the lens one uses for the scene. Say, if you use a wide angle lens (28mm as a standard), you should have a wide depth of sharpness. If you use a zoom lens (about 135mm or more) the depth of sharpness shrinks. This is a common technique in photographic scenes (portrait, still life, food, and so on) to seperate objects from the fore- or background.
This comes in handy, if you make a "shot" with small details in the foreground. Like grass blades, stones or any small object like flowers or the like you want to have in the point of interest. TG artist certainly take shots of some shrubbery, bushes orsingle flowers. In that case, one would need DOF.
Title: Re: Distance Blur?
Post by: efflux on January 07, 2007, 07:28:10 PM
I think it would be useful to have in TG but for wide open landscapes it can look odd because we are used to looking at photos of close subjects with narrow depth of field.
Title: Re: Distance Blur?
Post by: Volker Harun on February 23, 2007, 08:12:11 AM
Regarding the distance-shader:

How do you set up the lighting?

At the moment I use the following setup, but still have artifacts due to the lighting:
GI: off
Environmental lighting: off
Heavy, but uniform overcasted sky
4 suns at 0°, 90°, ... at height of 45° strength each '1'; any shadow and glow turned off.

Regards,
Volker Harun

attached, an image with 3 Suns
Title: Re: Distance Blur?
Post by: Oshyan on February 23, 2007, 07:17:32 PM
Disable lighting entirely - it has no function in this case. Make sure all your objects have the Distance Shader connected as their Surface Shader input, along with the terrain. Turn off the atmosphere as well. That should give you the result you need.

- Oshyan
Title: Re: Distance Blur?
Post by: sjefen on October 06, 2007, 02:50:06 PM
I'm sorry to bring this topic back from the dead, but I just need a little help.

I have a scene where i want to have a depth of field effect. Do I first render it normal, then rerender it with the distance shader on all my shaders? And how do I use them together to get the depth of field effect? Do I need photoshop CS2 or better?
Title: Re: Distance Blur?
Post by: 3DGuy on October 06, 2007, 07:41:40 PM
Render it like you said, 1 normal, 1 with the distance shader. Then open your images in photoshop. Copy the distance shader render to a new channel  (and call it depthfield). Go back to the normal RGB view/layer then from the filter menu choose blur, lens blur (I think it's present in CS2) and use the channel depthfield as a source. then you can play with the blur.

If you don't have the lens blur filter, hold the ctrl key and click on the depthfield channel. This will give you a selection. Then use gaussian blur to set the amount of blur you need.
Title: Re: Distance Blur?
Post by: bigben on October 06, 2007, 10:40:35 PM
Quote from: MooseDog on January 07, 2007, 10:23:42 AM
...
for a depth pass, you could pull it off right now with a brute force workflow.  just texture your terrain jet black, texture your atmosphere jet white, and then set-up a white fog, which you can then control density and distance.  presto! instant depth pass.

An interesting approach, but how does the render time stack up against using the distance shader?
Title: Re: Distance Blur?
Post by: Cyber-Angel on October 07, 2007, 12:54:23 AM
I hope that in future that the camera in TG2 will support Depth of Field with a focus point just like real cameras have, it would be nice if the camera system in TG2 also supported different types of diaphragms, also pincushion and Barrel Distortion(Found in the telephoto range, but also in some models of fish eye lenses which we are told we will have in the future)  , vignetting would also be nice http://en.wikipedia.org/wiki/Vignetting  and if there is time Boken aberration http://en.wikipedia.org/wiki/Bokeh.

In future could we have support for a thin film Optics System in TG2 http://en.wikipedia.org/wiki/Thin-film_optics in that way effects would be possible such as opalescence not currently possible with TG2 and as a photographer my self these things would be welcomed.

Control over aperture and Exposure would also be nice.

Regards to you.

Cyber-Angel 
             
Title: Re: Distance Blur?
Post by: bigben on October 07, 2007, 01:57:48 AM
Have a play with Photoshop's Lens Blur filter. That will give you a reasonable amount of options.
Iris: 3 - 8 sided polygon
Variable blade curvature and rotation
Noise addition etc...

I had a quick play (again) following my earlier tests the last time this topic came up.  As suggested above, turned off all lighting, atmosphere and used a distance shader as the last shader for surfaces and on all objects. As the PS filter includes a distance selection, it's better to use a near distance of 0 (black) and a far distance of whatever you want the hyperfocal distance to be (500m in this case, white).

This seems to give a better result than masking near and far distances and using a standard blur filter.
Title: Re: Distance Blur?
Post by: Cyber-Angel on October 07, 2007, 03:03:17 AM
Bigben

What version of Photoshop do you have that has that filter I am kind of behind the times (Vary) since I have 5.5

Regards to you.

Cyber-Angel
Title: Re: Distance Blur?
Post by: Saurav on October 07, 2007, 03:41:55 AM
The lens blur filter is present from version cs and up.
Title: Re: Distance Blur?
Post by: sjefen on October 07, 2007, 10:15:55 AM
Thank you for the answer 3DGuy but I'm really rusty in photoshop. If I add new channel it becomes totally black. I don't understand how I can copy my distance shader in there
Title: Re: Distance Blur?
Post by: Volker Harun on October 07, 2007, 12:15:06 PM
Sjefen,
you should deselect all other channels first by clicking on the eye-icon. Highlight the new channel and paste the b-w-mask in there.
Title: Re: Distance Blur?
Post by: 3DGuy on October 07, 2007, 12:21:11 PM
In the image with the distance shader press CTRL+A then CTRL+C
Then in the new channel (which is black by default) press CTRL+V
Title: Re: Distance Blur?
Post by: sjefen on October 07, 2007, 12:35:24 PM
Thank you very much ;)
Title: Re: Distance Blur?
Post by: Anthony on October 10, 2007, 12:07:29 AM
They probably haven't included it before because in landscapes there is almost no DOF blur. It is only apparent when you are looking at things relatively close...
Title: Re: Distance Blur?
Post by: cyphyr on October 10, 2007, 12:18:41 AM
BigBen ~ Your image looks like a scale model, I expect to see little plastic model solders in there, a very effective and interesting technique.
Richard
Title: Re: Distance Blur?
Post by: bigben on October 10, 2007, 01:39:38 AM
I was thinking more of a model steam train myself.  Probably helped by the fact that the surface looks more brushed oil paint. Possibly an interesting theme to explore when you get sick of trying for super-realistic landscapes
Title: Re: Distance Blur?
Post by: cyphyr on October 10, 2007, 05:20:12 AM
I got to thinking last night (it was very late so I'm probably deluded  ::)) that this technique could be used in other ways as well. In stead of blurring it could be used to control saturation so the further away from the camera the more desaturated the colours become. This is pretty much what the haze controls does now but it would be useful to have that extra degree of control in post.
Need more coffee...
Richard
Title: Re: Distance Blur?
Post by: bigben on October 11, 2007, 06:42:26 PM
I sometimes use the distance shader to increase the amount of blue on the terrain at longer distances. This requires less juggling than attempting it with atmosphere/lighting settings which can have adverse effects on other parts of the image... although I use it as more of a tweak than a substitute.
Title: Re: Distance Blur?
Post by: dhavalmistry on October 11, 2007, 09:46:00 PM
I am having little trouble using distance shader...I want to remove fog/haze around the camera.....and I cant get it to work...can some body post a screen shot of how are you supposed to setup distance shader please??......
Title: Re: Distance Blur?
Post by: bigben on October 11, 2007, 11:26:22 PM
Assuming you're using a cloud layer for the fog...

No fog to 200m then increasing to full fog at 1000m

[edit2] Cloud coverage must be <= 0

Had a bit more of a play.... There may still be some issues with the distance shader. It may preview oddly so do a quick render to check the effectiveness.  Otherwise it may be necessary to manually replicate the effect with functions.

The odd stuff looks similar to a problem with the get camera position function http://forums.planetside.co.uk/index.php?topic=1591.0 (http://forums.planetside.co.uk/index.php?topic=1591.0). Haven't checked this with the update yet.[/edit2]