Author Topic: Advanced Tutorial: Better DoF Screenshots  (Read 1467 times)


This is a tutorial on how to make lovey DoF screenshots in post using a depthmap. This was written mainly for GIMP, but you should be able to figure it out in Photoshop.

Left: Normal screenshot
Center: Depthmap generated with shader
Right: DoF screenshot from screenshot and depthmap

There are two methods that can be used to create a depth map:

Method One: Manual Creation


Pros:
  • Can be applied to any screenshot
  • More control over the focus
  • No shaders needed

Cons:
  • Less realistic
  • Requires some skill with image editing
  • Time intensive for more complicated images
  • Can look bad if not enough cared was taken in creating the depthmaps

Go to Section 1 for manual creation.



Method Two: Shader Generated


Pros:
  • More realistic
  • Might look better depending on your taste
  • Much quicker for more complicated images

Cons:
  • Depthmap must be generated at the time of screenshot-- cannot be applied to old screenshots
  • May be hard to do on multiplayer, super admin is required
  • You computer must be able to run shaders
  • Requires at little techincal skill


Go to Section 2 for shader generated depthmaps.
« Last Edit: September 01, 2012, 05:31:32 PM by Tammy »

Section 1: Manually Creating Depthmaps

1. Create a copy of your screenshot and open it in your image manipulation program.

2. Create a depthmap of your image by splitting it into parts and coloring them based on how in focus you want them to be. Pure black will be sharp, white will be blurry. Anywhere in between will be, well, in between. As you can see I used a few seperate layers to keep things organized.




3. Merge the layers and save.

Congratulation! You should now have a screenshot and a depthmap!

If you are using GIMP, skip to Section 3.
If you are using Adobe Photoshop, skip to Section 4.
« Last Edit: September 01, 2012, 05:31:10 PM by Tammy »

Section 2: Generating Depthmaps with Shaders

Getting Started: This process will probably only work well if Blockland is in windowed mode. It is also recommened that this is only done in single player. You will need to be admin so you can change enviroment settings. Your computer will need to be able to run at least minimum shaders.

1. Position your camera to where you will want it to be for the screnshot. Once you are there you cannot move until the process is completed.

2. Take the screenshot

3. Being careful not to move the camera, use enviromental controls to set the skybox to Costruct (pure white). Go to the advanced tab. Turn vingetteing off and if the sun flare is in the camera view you will need to turn that off too.

4. While Blockland is still open, open the "Blockland/shaders/common.glsl" and scroll down to the bottom.




5. Insert these lines of code right above return fragColor:

Code: [Select]
  float depthColor = vPos.y * 0.015f;
   depthColor = depthColor / (depthColor + 1.0f);
   fragColor.x = depthColor;
   fragColor.y = depthColor;
   fragColor.z = depthColor;
   fragColor.w = depthColor;




6. Save the file.

7. Go back into Blockland and set your shaders to "Minimum". Everything should turn black and white.

8. Take a Screenshot.

Congratulations! You should now have a screenshot and a depthmap!

If you are using GIMP, skip to Section 3.
If you are using Adobe Photoshop, skip to Section 4.
« Last Edit: September 01, 2012, 05:31:18 PM by Tammy »

Section 3: Post-Processing with GIMP

Getting Started: Download and install the Focus Blur plugin.

1. Open both your screenshot and the generated depthmap.

2. On the screenshot, select "Filters > Blur > Focus Blur".

3. Set the depthmap. If you are using a shader-generated depthmap, move the "Focal depth" slider until the desired object is in focus. If you manually created your depthmap, leave that slider alone!



4. Feel free to mess around with the other settings. I recommend turning on "Depth with precedence" in the "Depth" tab.

5. When everything is set how you like, press "Ok" to apply the blur. It may take a little while.

Congratulation! You should now have a very nice DoF screenshot.
« Last Edit: September 01, 2012, 05:32:29 PM by Tammy »


Section 4: Post-Processing with Adobe Photoshop

You'll have to figure this out on your own, I don't have Photoshop. Here is a refrence on the filter you'll need to use:
http://www.computer-darkroom.com/tutorials/tutorial_9_1.htm

:o

Taking blockland pictures to a whole new level