DOF autofocus debug
- Niko of Death
- Topic Author
Less
More
I have been working on setting up dof shaders in as many games as I can. Unfortunately, in many cases it is difficult to properly setup the autofocus, as it is unclear precisely where the focus point is. A debug option that shows the area that the shader is focused on would be extremely helpful, if it is possible.
The following user(s) said Thank You: AssassinsDecree
Please Log in or Create an account to join the conversation.
- AssassinsDecree
Less
More
Couldn't agree more. Hope this happens one day.
Please Log in or Create an account to join the conversation.
- moriz1
Less
More
if you have some basic coding knowledge, it's pretty easy to just write a focus point shader yourself.
you can also modify existing DoF shaders to display debug info, using the DrawText.fxh header file.
i made use of this in my KuwaharaDoF shader. here's the code snippet:
basically, if the debug toggle is pressed, it displays your current mouse coordinates, as well as the depth value that the shader is focusing on.
you can also modify existing DoF shaders to display debug info, using the DrawText.fxh header file.
i made use of this in my KuwaharaDoF shader. here's the code snippet:
#include "DrawText.fxh"
.
.
.
if (ShowDebug) {
float res = -0.1;
int line0[13] = { __M, __o, __u, __s, __e, __Space, __C, __o, __o, __r, __d, __Colon, __Space };
DrawText_String(float2(100.0, 132.0), 32, 1, tex, line0, 13, res);
DrawText_Digit(DrawText_Shift(float2(200.0, 132.0), int2(13, 0), 32, 1), 32, 1, tex, 0, MouseCoord.x, res);
DrawText_Digit(DrawText_Shift(float2(400.0, 132.0), int2(13, 0), 32, 1), 32, 1, tex, 0, MouseCoord.y, res);
DrawText_Digit(DrawText_Shift(float2(500.0, 132.0), int2(13, 0), 32, 1), 32, 1, tex, 3, focusPoint, res);
if ( res != -0.1)
return res;
}
basically, if the debug toggle is pressed, it displays your current mouse coordinates, as well as the depth value that the shader is focusing on.
Please Log in or Create an account to join the conversation.
- luluco250
Less
More
I think OP means something more along the lines of a visual debug, like a depth texture where the areas in focus are colorized.
Please Log in or Create an account to join the conversation.
- OtisInf
Less
More
My new DOF shader for reshade (Cinematic DOF) implements this:
reshade.me/forum/shader-presentation/453...matic-depth-of-field
Hope this helps and you like the shader
Hope this helps and you like the shader
Please Log in or Create an account to join the conversation.