# How do I compute a details variant for a well-known value of the regular circulation function?

I am creating a Gaussian blur filter in graphics shader code. I intend to make the blur parameterized by distance from the customers viewpoint. The most effective method I can figure to do this is to select an ideal quiting factor for y, claim.001, and also address for the difference to link into the regular circulation function that will certainly attain that value of y.

Unfortunately I can except the life of me address this formula for v.

$x = 10$ (blur radius )

$$.001 = \frac{1}{2 \pi v^2}e^{-\frac{x^2}{2v^2}}$$.

To expand on the pointer to make use of the Lambert function, I'll demonstrate how it emerges in your formula of passion.

Beginning with

$y=\frac1{2\pi v^2}\exp\left(-\frac{x^2}{2v^2}\right)$

we increase both sides by $-\pi x^2$ to offer

$-\pi x^2 y=-\frac{x^2}{2v^2}\exp\left(-\frac{x^2}{2v^2}\right)$

which can currently be inverted to the Lambert function (recall that the Lambert function $W(z)$ is the inverted function of $z\exp(z)$, $W(z)\exp(W(z))=z$):

$-\frac{x^2}{2v^2}=W(-\pi x^2 y)$

which we can currently address for $v$

$v=\frac{x}{\sqrt{-2W(-\pi x^2 y)}}$

The selection of indicator for the square origin is encouraged by the reality that differences are traditionally required favorable.

I do not assume the distance needs to entail the difference. You can simply make use of the distance to scale the x - axis.

So you can example the circulation from - 1 to 1, constantly. If the distance is 4, would certainly example 9 areas. For 10 you example 21 times in between - 1 and also 1. The difference can remain the very same.

You could intend to attempt this inquiry below also https://gamedev.stackexchange.com/.

Related questions