Welcome, Guest.
Username: Password: Remember me

TOPIC: DOF autofocus debug

DOF autofocus debug 4 months 3 days ago #1

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 administrator has disabled public write access.
The following user(s) said Thank You: AssassinsDecree

DOF autofocus debug 2 months 2 weeks ago #2

Couldn't agree more. Hope this happens one day.
The administrator has disabled public write access.

DOF autofocus debug 2 months 2 weeks ago #3

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:
#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.
The administrator has disabled public write access.

DOF autofocus debug 2 months 2 weeks ago #4

I think OP means something more along the lines of a visual debug, like a depth texture where the areas in focus are colorized.
Likes to reinvent the wheel.

My shaders repository: www.github.com/luluco250/FXShaders
The administrator has disabled public write access.