HOME | DD

XnaFreak — Far Plane settings and Dof

#shader #xps #xnalara #update
Published: 2019-03-06 13:32:51 +0000 UTC; Views: 2116; Favourites: 20; Downloads: 25
Redirect to original
Description I get never the full contrast for Depth of field shader in the new XPS 11.8.7 update.


Depth of field is the distance between the nearest and the furthest objects that are in acceptably sharp focus in an image. The depth of field is determined by focal length, distance to subject, the acceptable circle of confusion size, and aperture. (Or in XPS just a matter of "Config->Preference-General->Far Plane Distance")
A particular depth of field may be chosen for technical or artistic purposes. Some post-processing methods, such as focus stacking allow extended depth of field that would be impossible with traditional techniques.


I want to have the nearest part of the model (not of the floor) in white, and the furthest part of the model in black. "Far Plane Distance 4" (FPD)is almost ok, but already losing dynamic. And "FPD 5" is already to much

Let's see if I can modify the XPS shader. Thanks, it is a "user written shader" (HLSL shader) in source code


EDIT

Done
Z-Depth pass render to make a Depth of Field (DoF) effect. Image: sta.sh/01ly79i4plaj

The code was almost correct. Just the alpha calculation was missing.
I've add, for more artist freedom, to customize the Z-Depth pass. Settings with "3D window" Ctrl+J
The render pass create 3 areas:
- Background (black) for full blur effect. Adjustable with "Parameter 1"
- Foreground (white) for no blur effect. Adjustable with "Parameter 2" (10 cm range) and "Parameter 2" (1m range)
- Middleground (grayscale). The frustum between background and foreground.
"Parameter 4" is just the brightness.

How to use the Z-Depth pass for making the Dof ?
www.studiorola.com/tutorials/r…

Download link new Z-Depth DoF  shader to created the Depth of Field effect.: sta.sh/01zbgsakmg02
Related content
Comments: 8

TSelman61 [2019-03-06 15:08:36 +0000 UTC]

It's getting interesting.   

👍: 0 ⏩: 1

XnaFreak In reply to TSelman61 [2019-03-08 16:27:47 +0000 UTC]

Yes

DoF test far plane distance 150 Z-Depth render pass


Z-Depth DoF shader


👍: 0 ⏩: 0

XnaFreak [2019-03-06 13:47:47 +0000 UTC]

.

👍: 0 ⏩: 0

SSPD077 [2019-03-06 13:42:02 +0000 UTC]

good luck     

👍: 0 ⏩: 1

XnaFreak In reply to SSPD077 [2019-03-06 13:48:05 +0000 UTC]

Just a matter of "Think outside the Box" (and some shader magic, like this )

👍: 0 ⏩: 1

SSPD077 In reply to XnaFreak [2019-03-06 13:49:10 +0000 UTC]

  can't wait to see what u come up with ^^  

👍: 0 ⏩: 1

XnaFreak In reply to SSPD077 [2019-03-06 13:55:02 +0000 UTC]

#me too   

👍: 0 ⏩: 1

SSPD077 In reply to XnaFreak [2019-03-06 13:57:04 +0000 UTC]

^w^ 

👍: 0 ⏩: 0